<?php
    session_start();
    if(!isset($_SESSION['usuario'])){
            header('location:../html/login.html');
         }
         
         echo '<center>
                    <title>Control de Transfusion Sanguinea</title>
                    <table>
                        <tr>
                            <td>';
                         include_once 'menu.php';
                        echo"</td>
                        </tr>
                    </table></br></br>";
?>

<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        
        <!-- ESTILO DEL FORMULARIO -->
        <link href="../../Ginecobstetricia/vista/css/bootstrap-combined.min.css" rel="stylesheet">
        
        <!-- LIBRERIAS JQUERY Y CSS PARA LA CREACION DE LAS ALERTAS -->
        <script type="text/javascript" src="../../Ginecobstetricia/vista/js/alertify.js"></script>
	<link rel="stylesheet" href="../../Ginecobstetricia/vista/css/alertify.core.css" />
	<link rel="stylesheet" href="../../Ginecobstetricia/vista/css/alertify.default.css" />
        
        
        <script type="text/javascript" src="../../Laboratorio/vista/datepicker/jquery-ui.min.js"></script>
        <script type="text/javascript" src="../../Laboratorio/vista/datepicker/jquery-ui-timepicker-addon.js"></script>
        <script type="text/javascript" src="../../Laboratorio/vista/datepicker/jquery-ui-sliderAccess.js"></script>
        <link rel="stylesheet" media="all" type="text/css" href="../../Laboratorio/vista/datepicker/jquery-ui.css" />
	<link rel="stylesheet" media="all" type="text/css" href="../../Laboratorio/vista/datepicker/jquery-ui-timepicker-addon.css" />
        
        <script>
            
            
            function verificarC(){
                var codUnidad = $("#numS").val();
                $.ajax({
                        type: "POST",
                        dataType: "json",
                        contentType: "application/x-www-form-urlencoded; charset=UTF-8",
                        url: "../../Laboratorio/controlador/php/sql/datosVeri.php",
                        data: {codUnidad:codUnidad},
                        success: resu,
                        timeout: 4000
                    });
            }
            
            function resu(can){
                if($("#medi").val() === "" ){
                    var res = can.resp;
                    if(res == 1){
                        datosUni();
                    }else if(res == 2){
                        unidadesR();
                    }else if(res == 3){
                        alertify.error("No se encuentran datos de la unidad..."); 
                    }
                
                }else{
                    alertify.confirm("<p>PARA REGISTRAR UNA NUEVA UNIDAD DEBE RECARGAR LA PAGINA</p>", function (e) {
                        if (e) {
                           document.location=("lTransR.php");
                        } else { 

                        }
                        }); 
                        return false;
                }
                
            }
            
            
            function unidadesR(){
                var codUnidad = $("#numS").val();
                $.ajax({
                    type: "POST",
                    contentType: "application/x-www-form-urlencoded; charset=UTF-8",
                    url: "../../Laboratorio/controlador/php/sql/datosUni.php",
                    data: {codUnidad:codUnidad},
                    success: mostrarDU3,
                    timeout: 4000,
                    error: errorEnvio
                });
            }
            
            function mostrarDU3(respuesta){
                rpt = $.parseJSON(respuesta);
                respuesta = $("#respuesta");
                var resp = "";
                document.getElementById("respuesta2").innerHTML = "<font color='red'>ESTE NUMERO DE SELLO CUENTA CON VARIAS UNIDADES REGISTRADAS </br> POR FAVOR SEÑALE LA UNIDAD REQUERIDA </font></br></br>";
               for(dato in rpt){
                   var componente = rpt[dato].ltr_componente;
                   if(componente === "pqm"){
                        var compo = "PLAQ MANUAL";
                    }else if(componente=== "grpl"){
                        compo = "GRPL";
                    }else if(componente=== "grf"){
                        compo = "GRF";
                    }else if(componente === "pfc"){
                        compo = "PFC";
                    }else if(componente === "cro"){
                        compo = "CRIO";
                    }else if(componente === "pqa"){
                        compo = "PLAQ POR AF";
                    }
                    
                    respuesta.append("<table style='font-size:90%;overflow:hidden;border:1px solid #d3d3d3;background:#fefefe;width:70%;-moz-border-radius:5px; /* FF1+ */-webkit-border-radius:5px; /* Saf3-4 */border-radius:5px;-moz-box-shadow: 0 0 4px rgba(0, 0, 0, 0.2);-webkit-box-shadow: 0 0 4px rgba(0, 0, 0, 0.2);font-size:12px'>\
                                        <tr>\
                                            <td colspan='6' style='padding:2px 2px 2px; text-align:center;border-top:1px solid #e0e0e0; border-right:1px solid #e0e0e0;background: -moz-linear-gradient(100% 25% 90deg, #fefefe, #f9f9f9);background: -webkit-gradient(linear, 0% 0%, 0% 25%, from(#f9f9f9), to(#fefefe)); background:#e8eaeb;'>\
                                                <strong>INFORMACION DE LA UNIDAD</strong>\
                                            </td>\
                                        </tr>\
                                        <tr>\
                                            <td style='font-size:90%;padding:2px 2px 2px; text-align:center;border-top:1px solid #e0e0e0; border-right:1px solid #e0e0e0;background: -moz-linear-gradient(100% 25% 90deg, #fefefe, #f9f9f9);background: -webkit-gradient(linear, 0% 0%, 0% 25%, from(#f9f9f9), to(#fefefe)); background:#e8eaeb;'>\
                                                <strong>Numero de Sello</strong>\
                                            </td>\
                                            <td style='font-size:90%;padding:2px 2px 2px; text-align:center;border-top:1px solid #e0e0e0; border-right:1px solid #e0e0e0;background: -moz-linear-gradient(100% 25% 90deg, #fefefe, #f9f9f9);background: -webkit-gradient(linear, 0% 0%, 0% 25%, from(#f9f9f9), to(#fefefe)); background:#e8eaeb;'>\
                                                <strong>Componente</strong>\
                                            </td>\
                                            <td style='font-size:90%;padding:2px 2px 2px; text-align:center;border-top:1px solid #e0e0e0; border-right:1px solid #e0e0e0;background: -moz-linear-gradient(100% 25% 90deg, #fefefe, #f9f9f9);background: -webkit-gradient(linear, 0% 0%, 0% 25%, from(#f9f9f9), to(#fefefe)); background:#e8eaeb;'>\
                                                <strong>Documento</strong>\
                                            </td>\
                                            <td style='font-size:90%;padding:2px 2px 2px; text-align:center;border-top:1px solid #e0e0e0; border-right:1px solid #e0e0e0;background: -moz-linear-gradient(100% 25% 90deg, #fefefe, #f9f9f9);background: -webkit-gradient(linear, 0% 0%, 0% 25%, from(#f9f9f9), to(#fefefe)); background:#e8eaeb;'>\
                                                <strong>Paciente</strong>\
                                            </td>\
                                            <td style='font-size:90%;padding:2px 2px 2px; text-align:center;border-top:1px solid #e0e0e0; border-right:1px solid #e0e0e0;background: -moz-linear-gradient(100% 25% 90deg, #fefefe, #f9f9f9);background: -webkit-gradient(linear, 0% 0%, 0% 25%, from(#f9f9f9), to(#fefefe)); background:#e8eaeb;'>\
                                                <strong>Servicio</strong>\
                                            </td>\
                                            <td style='font-size:90%;padding:2px 2px 2px; text-align:center;border-top:1px solid #e0e0e0; border-right:1px solid #e0e0e0;background: -moz-linear-gradient(100% 25% 90deg, #fefefe, #f9f9f9);background: -webkit-gradient(linear, 0% 0%, 0% 25%, from(#f9f9f9), to(#fefefe)); background:#e8eaeb;'>\
                                                <strong>Ver Unidad</strong>\
                                            </td>\
                                        </tr>\
                                        <tr>\
                                            <td style='font-size:90%;padding:18px 28px 18px;border-top:1px solid #e0e0e0; border-right:1px solid #e0e0e0;background: -moz-linear-gradient(100% 25% 90deg, #fefefe, #f9f9f9);background: -webkit-gradient(linear, 0% 0%, 0% 25%, from(#f9f9f9), to(#fefefe));'>\
                                            "+ rpt[dato].ltr_numSe +"\
                                            </td>\
                                            <td style='font-size:90%;padding:18px 28px 18px;border-top:1px solid #e0e0e0; border-right:1px solid #e0e0e0;background: -moz-linear-gradient(100% 25% 90deg, #fefefe, #f9f9f9);background: -webkit-gradient(linear, 0% 0%, 0% 25%, from(#f9f9f9), to(#fefefe));'>\
                                            "+ compo +"\
                                            </td>\
                                            <td style='font-size:90%;padding:18px 28px 18px;border-top:1px solid #e0e0e0; border-right:1px solid #e0e0e0;background: -moz-linear-gradient(100% 25% 90deg, #fefefe, #f9f9f9);background: -webkit-gradient(linear, 0% 0%, 0% 25%, from(#f9f9f9), to(#fefefe));'>\
                                            "+ rpt[dato].PACNUMDOC +"\
                                            </td>\
                                            <td style='font-size:90%;padding:18px 28px 18px;border-top:1px solid #e0e0e0; border-right:1px solid #e0e0e0;background: -moz-linear-gradient(100% 25% 90deg, #fefefe, #f9f9f9);background: -webkit-gradient(linear, 0% 0%, 0% 25%, from(#f9f9f9), to(#fefefe));'>\
                                            "+ rpt[dato].PACPRINOM +' '+ rpt[dato].PACSEGNOM +' '+ rpt[dato].PACPRIAPE +' '+ rpt[dato].PACSEGAPE +"\
                                            </td>\
                                            <td style='font-size:90%;padding:18px 28px 18px;border-top:1px solid #e0e0e0; border-right:1px solid #e0e0e0;background: -moz-linear-gradient(100% 25% 90deg, #fefefe, #f9f9f9);background: -webkit-gradient(linear, 0% 0%, 0% 25%, from(#f9f9f9), to(#fefefe));'>\
                                            "+ rpt[dato].ser_descripcion +"\
                                            </td>\
                                            </td>\
                                            <td title='ver los datos de la unidad' onclick='cargarUnidad("+ rpt[dato].ltr_oid +","+ rpt[dato].adnIngreso +")'; style='cursor:pointer;padding:18px 28px 18px;border-top:1px solid #e0e0e0; border-right:1px solid #e0e0e0;background: -moz-linear-gradient(100% 25% 90deg, #fefefe, #f9f9f9);background: -webkit-gradient(linear, 0% 0%, 0% 25%, from(#f9f9f9), to(#fefefe));'>\
                                            <img src='../imagen/vers.png' width='25' height='25' alt='vers'/>\
                                            </td>\
                                        </tr>\
                                    </table>");
               }
            }
            
            
            function cargarUnidad(ltr_oid,Ingreso){
                var oidltr = ltr_oid;
                
                $.ajax({
                        type: "POST",
                        contentType: "application/x-www-form-urlencoded; charset=UTF-8",
                        url: "../../Laboratorio/controlador/php/sql/datosUni2.php",
                        data: {oidltr:oidltr,Ingreso:Ingreso},
                        success: tablaUnidad,
                        timeout: 4000,
                        error: errorEnvio
                    });
                
                
            }
            
            
            function tablaUnidad(respuesta){
                rpt = $.parseJSON(respuesta);
                respuesta = $("#respuesta");
                var resp = "";
                
               for(dato in rpt){
                   document.getElementById("ingreso").value= rpt[dato].adnIngreso;
                   var servicio  = rpt[dato].ser_descripcion;
                   var componente  = rpt[dato].ltr_componente;
                   var grupos  = rpt[dato].ltr_grupoS;
                   var tamizaje  = rpt[dato].ltr_tamizaje;
                   var numu  = rpt[dato].ltr_numU;
                   var nums  = rpt[dato].ltr_numSe;
                   var fechav  = rpt[dato].ltr_fechaV;
                   var gruposu  = rpt[dato].ltr_gruposu;
                   var rai1  = rpt[dato].ltr_rai1;
                   var rai2  = rpt[dato].ltr_rai2;
                   var autocontrol  = rpt[dato].ltr_autoC;
                   var pruebac  = rpt[dato].ltr_pruebC;
                   var bacres  = rpt[dato].usu_nombres + " " + rpt[dato].usu_apellidos;
                   var nombres  = rpt[dato].PACPRINOM;
                   var nombres2  = rpt[dato].PACSEGNOM;
                   var apellido  = rpt[dato].PACPRIAPE;
                   var apellido2  = rpt[dato].PACSEGAPE;
                   var documento  = rpt[dato].PACNUMDOC;
                   var temp  = rpt[dato].ltr_tempS;
                   var estado  = rpt[dato].ltr_estadoU;
                   var fecha = rpt[dato].ltr_fecha;
                   var orientador = rpt[dato].ltr_qrecibe;
                   var oidb = rpt[dato].ltr_oid;
                   var oidb = rpt[dato].ltr_oid;
                   var numn = rpt[dato].ltr_numN;
               }
                   if(componente === "pqm"){
                        var compo = "PLAQ MANUAL";
                    }else if(componente=== "grpl"){
                        compo = "GRPL";
                    }else if(componente=== "grf"){
                        compo = "GRF";
                    }else if(componente === "pfc"){
                        compo = "PFC";
                    }else if(componente === "cro"){
                        compo = "CRIO";
                    }else if(componente === "pqa"){
                        compo = "PLAQ POR AF";
                    }
               
               $("#respuesta").html("<table style='overflow:hidden;border:1px solid #d3d3d3;background:#fefefe;width:70%;-moz-border-radius:5px; /* FF1+ */-webkit-border-radius:5px; /* Saf3-4 */border-radius:5px;-moz-box-shadow: 0 0 4px rgba(0, 0, 0, 0.2);-webkit-box-shadow: 0 0 4px rgba(0, 0, 0, 0.2);font-size:12px'>\
                                    <tr>\
                                     <td colspan='4' style='padding:18px 28px 18px; text-align:center;border-top:1px solid #e0e0e0; border-right:1px solid #e0e0e0;background: -moz-linear-gradient(100% 25% 90deg, #fefefe, #f9f9f9);background: -webkit-gradient(linear, 0% 0%, 0% 25%, from(#f9f9f9), to(#fefefe)); background:#e8eaeb;'>\
                                         <strong>INFORMACION DEL PACIENTE</strong>\
                                     </td>\
                                     </tr>\
                                     <tr>\
                                     <td colspan='4' style='padding:18px 28px 18px; text-align:center;border-top:1px solid #e0e0e0; border-right:1px solid #e0e0e0;background: -moz-linear-gradient(100% 25% 90deg, #fefefe, #f9f9f9);background: -webkit-gradient(linear, 0% 0%, 0% 25%, from(#f9f9f9), to(#fefefe));'>"
                                     + "<font color='#6E6E6E'>"  + fecha + "</font>" + 
                                     "</td>\
                                     </tr>\
                                     <tr>\
                                     <td style='padding:18px 28px 18px;border-top:1px solid #e0e0e0; border-right:1px solid #e0e0e0;background: -moz-linear-gradient(100% 25% 90deg, #fefefe, #f9f9f9);background: -webkit-gradient(linear, 0% 0%, 0% 25%, from(#f9f9f9), to(#fefefe));'>\
                                         <i>Nombres</i>\
                                     </td>\
                                     <td style='padding:18px 28px 18px; text-align:center;border-top:1px solid #e0e0e0; border-right:1px solid #e0e0e0;background: -moz-linear-gradient(100% 25% 90deg, #fefefe, #f9f9f9);background: -webkit-gradient(linear, 0% 0%, 0% 25%, from(#f9f9f9), to(#fefefe));'>"
                                     + "<font color='#6E6E6E'>"  + nombres + " " + nombres2 + "</font>" +
                                     "</td>\
                                     \
                                     \
                                     <td style='padding:18px 28px 18px;border-top:1px solid #e0e0e0; border-right:1px solid #e0e0e0;background: -moz-linear-gradient(100% 25% 90deg, #fefefe, #f9f9f9);background: -webkit-gradient(linear, 0% 0%, 0% 25%, from(#f9f9f9), to(#fefefe));'>\
                                         <i>Apellidos</i>\
                                     </td>\
                                     <td style='padding:18px 28px 18px; text-align:center;border-top:1px solid #e0e0e0; border-right:1px solid #e0e0e0;background: -moz-linear-gradient(100% 25% 90deg, #fefefe, #f9f9f9);background: -webkit-gradient(linear, 0% 0%, 0% 25%, from(#f9f9f9), to(#fefefe));'>"
                                     + "<font color='#6E6E6E'>"  + apellido + " " + apellido2 + "</font>" + 
                                     "</td>\
                                     </tr>\
                                     <tr>\
                                     <td style='padding:18px 28px 18px;border-top:1px solid #e0e0e0; border-right:1px solid #e0e0e0;background: -moz-linear-gradient(100% 25% 90deg, #fefefe, #f9f9f9);background: -webkit-gradient(linear, 0% 0%, 0% 25%, from(#f9f9f9), to(#fefefe));'>\
                                         <i>Documento</i>\
                                     </td>\
                                     <td style='padding:18px 28px 18px; text-align:center;border-top:1px solid #e0e0e0; border-right:1px solid #e0e0e0;background: -moz-linear-gradient(100% 25% 90deg, #fefefe, #f9f9f9);background: -webkit-gradient(linear, 0% 0%, 0% 25%, from(#f9f9f9), to(#fefefe));'>"
                                     + "<font color='#6E6E6E'>"  + documento + "</font>" +
                                     "</td>\
                                     \
                                     \
                                     <td style='padding:18px 28px 18px;border-top:1px solid #e0e0e0; border-right:1px solid #e0e0e0;background: -moz-linear-gradient(100% 25% 90deg, #fefefe, #f9f9f9);background: -webkit-gradient(linear, 0% 0%, 0% 25%, from(#f9f9f9), to(#fefefe));'>\
                                         <i>Servicio</i>\
                                     </td>\
                                     <td style='padding:18px 28px 18px; text-align:center;border-top:1px solid #e0e0e0; border-right:1px solid #e0e0e0;background: -moz-linear-gradient(100% 25% 90deg, #fefefe, #f9f9f9);background: -webkit-gradient(linear, 0% 0%, 0% 25%, from(#f9f9f9), to(#fefefe));'>"
                                     + "<font color='#6E6E6E'>"  + servicio + "</font>" + 
                                     "</td>\
                                     </tr>\
                                     <tr>\
                                     <td style='padding:18px 28px 18px;border-top:1px solid #e0e0e0; border-right:1px solid #e0e0e0;background: -moz-linear-gradient(100% 25% 90deg, #fefefe, #f9f9f9);background: -webkit-gradient(linear, 0% 0%, 0% 25%, from(#f9f9f9), to(#fefefe));'>\
                                         <i>Grupo Sanguineo</i>\
                                     </td>\
                                     <td style='padding:18px 28px 18px; text-align:center;border-top:1px solid #e0e0e0; border-right:1px solid #e0e0e0;background: -moz-linear-gradient(100% 25% 90deg, #fefefe, #f9f9f9);background: -webkit-gradient(linear, 0% 0%, 0% 25%, from(#f9f9f9), to(#fefefe));'>"
                                     + "<font color='#6E6E6E'>"  + grupos + "</font>" +
                                     "</td>\
                                     \
                                     \
                                     <td style='padding:18px 28px 18px;border-top:1px solid #e0e0e0; border-right:1px solid #e0e0e0;background: -moz-linear-gradient(100% 25% 90deg, #fefefe, #f9f9f9);background: -webkit-gradient(linear, 0% 0%, 0% 25%, from(#f9f9f9), to(#fefefe));'>\
                                         <i>Componente</i>\
                                     </td>\
                                     <td style='padding:18px 28px 18px; text-align:center;border-top:1px solid #e0e0e0; border-right:1px solid #e0e0e0;background: -moz-linear-gradient(100% 25% 90deg, #fefefe, #f9f9f9);background: -webkit-gradient(linear, 0% 0%, 0% 25%, from(#f9f9f9), to(#fefefe));'>"
                                     + "<font color='#6E6E6E'>"  + compo + "</font>" + 
                                     "</td>\
                                     </tr>\
                                     <tr>\
                                     <td style='padding:18px 28px 18px;border-top:1px solid #e0e0e0; border-right:1px solid #e0e0e0;background: -moz-linear-gradient(100% 25% 90deg, #fefefe, #f9f9f9);background: -webkit-gradient(linear, 0% 0%, 0% 25%, from(#f9f9f9), to(#fefefe));'>\
                                         <i>Rastreo Anticuerpos</i>\
                                     </td>\
                                     <td style='padding:18px 28px 18px; text-align:center;border-top:1px solid #e0e0e0; border-right:1px solid #e0e0e0;background: -moz-linear-gradient(100% 25% 90deg, #fefefe, #f9f9f9);background: -webkit-gradient(linear, 0% 0%, 0% 25%, from(#f9f9f9), to(#fefefe));'>"
                                     + "<font color='#6E6E6E'>"  + rai1 + "</font>" +
                                     "</td>\
                                     \
                                     \
                                     <td style='padding:18px 28px 18px;border-top:1px solid #e0e0e0; border-right:1px solid #e0e0e0;background: -moz-linear-gradient(100% 25% 90deg, #fefefe, #f9f9f9);background: -webkit-gradient(linear, 0% 0%, 0% 25%, from(#f9f9f9), to(#fefefe));'>\
                                         <i>Autocontrol</i>\
                                     </td>\
                                     <td style='padding:18px 28px 18px; text-align:center;border-top:1px solid #e0e0e0; border-right:1px solid #e0e0e0;background: -moz-linear-gradient(100% 25% 90deg, #fefefe, #f9f9f9);background: -webkit-gradient(linear, 0% 0%, 0% 25%, from(#f9f9f9), to(#fefefe));'>"
                                     + "<font color='#6E6E6E'>"  + autocontrol + "</font>" + 
                                     "</td>\
                                     </tr>\
                                     <tr>\
                                     <td colspan='4' style='padding:18px 28px 18px; text-align:center;border-top:1px solid #e0e0e0; border-right:1px solid #e0e0e0;background: -moz-linear-gradient(100% 25% 90deg, #fefefe, #f9f9f9);background: -webkit-gradient(linear, 0% 0%, 0% 25%, from(#f9f9f9), to(#fefefe)); background:#e8eaeb;'>\
                                         <strong>INFORMACION UNIDAD TRANSFUSIONAL</strong>\
                                     </td>\
                                     </tr>\
                                     <tr>\
                                     <td style='padding:18px 28px 18px;border-top:1px solid #e0e0e0; border-right:1px solid #e0e0e0;background: -moz-linear-gradient(100% 25% 90deg, #fefefe, #f9f9f9);background: -webkit-gradient(linear, 0% 0%, 0% 25%, from(#f9f9f9), to(#fefefe));'>\
                                         <i>Numero Sello</i>\
                                     </td>\
                                     <td style='padding:18px 28px 18px; text-align:center;border-top:1px solid #e0e0e0; border-right:1px solid #e0e0e0;background: -moz-linear-gradient(100% 25% 90deg, #fefefe, #f9f9f9);background: -webkit-gradient(linear, 0% 0%, 0% 25%, from(#f9f9f9), to(#fefefe));'>"
                                     + "<font color='#6E6E6E'>" + nums + "</font>" + 
                                     "</td>\
                                     \
                                     \
                                     <td style='padding:18px 28px 18px;border-top:1px solid #e0e0e0; border-right:1px solid #e0e0e0;background: -moz-linear-gradient(100% 25% 90deg, #fefefe, #f9f9f9);background: -webkit-gradient(linear, 0% 0%, 0% 25%, from(#f9f9f9), to(#fefefe));'>\
                                         <i>Grupo Sanguineo Unidad</i>\
                                     </td>\
                                     <td style='padding:18px 28px 18px; text-align:center;border-top:1px solid #e0e0e0; border-right:1px solid #e0e0e0;background: -moz-linear-gradient(100% 25% 90deg, #fefefe, #f9f9f9);background: -webkit-gradient(linear, 0% 0%, 0% 25%, from(#f9f9f9), to(#fefefe));'>"
                                     + "<font color='#6E6E6E'>" + gruposu + "</font>" + 
                                     "</td>\
                                     \
                                     \
                                     <tr>\
                                     <td style='padding:18px 28px 18px;border-top:1px solid #e0e0e0; border-right:1px solid #e0e0e0;background: -moz-linear-gradient(100% 25% 90deg, #fefefe, #f9f9f9);background: -webkit-gradient(linear, 0% 0%, 0% 25%, from(#f9f9f9), to(#fefefe));'>\
                                         <i>Prueba Cruzada</i>\
                                     </td>\
                                     <td style='padding:18px 28px 18px; text-align:center;border-top:1px solid #e0e0e0; border-right:1px solid #e0e0e0;background: -moz-linear-gradient(100% 25% 90deg, #fefefe, #f9f9f9);background: -webkit-gradient(linear, 0% 0%, 0% 25%, from(#f9f9f9), to(#fefefe));'>"
                                     + "<font color='#6E6E6E'>" + pruebac + "</font>" +
                                     "</td>\
                                     \
                                     \
                                     <td style='padding:18px 28px 18px;border-top:1px solid #e0e0e0; border-right:1px solid #e0e0e0;background: -moz-linear-gradient(100% 25% 90deg, #fefefe, #f9f9f9);background: -webkit-gradient(linear, 0% 0%, 0% 25%, from(#f9f9f9), to(#fefefe));'>\
                                         <i>Bact. Responsable</i>\
                                     </td>\
                                     <td style='padding:18px 28px 18px; text-align:center;border-top:1px solid #e0e0e0; border-right:1px solid #e0e0e0;background: -moz-linear-gradient(100% 25% 90deg, #fefefe, #f9f9f9);background: -webkit-gradient(linear, 0% 0%, 0% 25%, from(#f9f9f9), to(#fefefe));'>"
                                     + "<font color='#6E6E6E'>" + bacres + "</font>" +
                                     "</td>\
                                     </tr>\
                                     <tr>\
                                     <td style='padding:18px 28px 18px;border-top:1px solid #e0e0e0; border-right:1px solid #e0e0e0;background: -moz-linear-gradient(100% 25% 90deg, #fefefe, #f9f9f9);background: -webkit-gradient(linear, 0% 0%, 0% 25%, from(#f9f9f9), to(#fefefe));'>\
                                         <i>Temperatura Unidad</i>\
                                     </td>\
                                     <td style='padding:18px 28px 18px; text-align:center;border-top:1px solid #e0e0e0; border-right:1px solid #e0e0e0;background: -moz-linear-gradient(100% 25% 90deg, #fefefe, #f9f9f9);background: -webkit-gradient(linear, 0% 0%, 0% 25%, from(#f9f9f9), to(#fefefe));'>"
                                     + "<font color='#6E6E6E'>" + temp + "ºC"  +"</font>" +
                                     "</td>\
                                     \
                                     \
                                     <td style='padding:18px 28px 18px;border-top:1px solid #e0e0e0; border-right:1px solid #e0e0e0;background: -moz-linear-gradient(100% 25% 90deg, #fefefe, #f9f9f9);background: -webkit-gradient(linear, 0% 0%, 0% 25%, from(#f9f9f9), to(#fefefe));'>\
                                         <i>Esatado Unidad</i>\
                                     </td>\
                                     <td style='padding:18px 28px 18px; text-align:center;border-top:1px solid #e0e0e0; border-right:1px solid #e0e0e0;background: -moz-linear-gradient(100% 25% 90deg, #fefefe, #f9f9f9);background: -webkit-gradient(linear, 0% 0%, 0% 25%, from(#f9f9f9), to(#fefefe));'>"
                                     + "<font color='#6E6E6E'>" + estado +"</font>" +
                                     "</td>\
                                     </tr>\
                                     <tr>\
                                     \
                                     <td style='padding:18px 28px 18px;border-top:1px solid #e0e0e0; border-right:1px solid #e0e0e0;background: -moz-linear-gradient(100% 25% 90deg, #fefefe, #f9f9f9);background: -webkit-gradient(linear, 0% 0%, 0% 25%, from(#f9f9f9), to(#fefefe));'>\
                                         <i>Orientador</i>\
                                     </td>\
                                     <td style='padding:18px 28px 18px; text-align:center;border-top:1px solid #e0e0e0; border-right:1px solid #e0e0e0;background: -moz-linear-gradient(100% 25% 90deg, #fefefe, #f9f9f9);background: -webkit-gradient(linear, 0% 0%, 0% 25%, from(#f9f9f9), to(#fefefe));'>"
                                     + "<font color='#6E6E6E'>" + orientador +"</font>" +
                                     "</td>\
                                     <td style='padding:18px 28px 18px;border-top:1px solid #e0e0e0; border-right:1px solid #e0e0e0;background: -moz-linear-gradient(100% 25% 90deg, #fefefe, #f9f9f9);background: -webkit-gradient(linear, 0% 0%, 0% 25%, from(#f9f9f9), to(#fefefe));'>\
                                         <i>Numero Nevera</i>\
                                     </td>\
                                     <td style='padding:18px 28px 18px; text-align:center;border-top:1px solid #e0e0e0; border-right:1px solid #e0e0e0;background: -moz-linear-gradient(100% 25% 90deg, #fefefe, #f9f9f9);background: -webkit-gradient(linear, 0% 0%, 0% 25%, from(#f9f9f9), to(#fefefe));'>"
                                     + "<font color='#6E6E6E'>" + numn +"</font>" +
                                     "</td>\
                                     </tr>\
                                     </table></br></br>");
               //document.getElementById("numS").value="";
               $("#oidb").attr("value",oidb);
               
               
               editarDatos();
               //cargarPac();
               $("#respuesta2").text("");
            }
            
            function datosUni(){
                    var codUnidad = $("#numS").val();
                    $.ajax({
                        type: "POST",
                        contentType: "application/x-www-form-urlencoded; charset=UTF-8",
                        url: "../../Laboratorio/controlador/php/sql/datosUni.php",
                        data: {codUnidad:codUnidad},
                        success: mostrarDU,
                        timeout: 4000,
                        error: errorEnvio
                    });
                
            }
            
            
            function errorEnvio() {
                    alert("error");
                }
            
            
            function mostrarDU(respuesta){
                rpt = $.parseJSON(respuesta);
                respuesta = $("#respuesta");
                var resp = "";
                
               for(dato in rpt){
                   document.getElementById("ingreso").value= rpt[dato].adnIngreso;
                   var servicio  = rpt[dato].ser_descripcion;
                   var componente  = rpt[dato].ltr_componente;
                   var grupos  = rpt[dato].ltr_grupoS;
                   var tamizaje  = rpt[dato].ltr_tamizaje;
                   var numu  = rpt[dato].ltr_numU;
                   var nums  = rpt[dato].ltr_numSe;
                   var fechav  = rpt[dato].ltr_fechaV;
                   var gruposu  = rpt[dato].ltr_gruposu;
                   var rai1  = rpt[dato].ltr_rai1;
                   var rai2  = rpt[dato].ltr_rai2;
                   var autocontrol  = rpt[dato].ltr_autoC;
                   var pruebac  = rpt[dato].ltr_pruebC;
                   var bacres  = rpt[dato].usu_nombres + " " + rpt[dato].usu_apellidos;
                   var nombres  = rpt[dato].PACPRINOM;
                   var nombres2  = rpt[dato].PACSEGNOM;
                   var apellido  = rpt[dato].PACPRIAPE;
                   var apellido2  = rpt[dato].PACSEGAPE;
                   var documento  = rpt[dato].PACNUMDOC;
                   var temp  = rpt[dato].ltr_tempS;
                   var estado  = rpt[dato].ltr_estadoU;
                   var fecha = rpt[dato].ltr_fecha;
                   var orientador = rpt[dato].ltr_qrecibe;
                   var oidb = rpt[dato].ltr_oid;
                   var oidb = rpt[dato].ltr_oid;
                   var numn = rpt[dato].ltr_numN;
               }
                   if(componente === "pqm"){
                        var compo = "PLAQ MANUAL";
                    }else if(componente=== "grpl"){
                        compo = "GRPL";
                    }else if(componente=== "grf"){
                        compo = "GRF";
                    }else if(componente === "pfc"){
                        compo = "PFC";
                    }else if(componente === "cro"){
                        compo = "CRIO";
                    }else if(componente === "pqa"){
                        compo = "PLAQ POR AF";
                    }
               
               $("#respuesta").html("<table style='overflow:hidden;border:1px solid #d3d3d3;background:#fefefe;width:70%;-moz-border-radius:5px; /* FF1+ */-webkit-border-radius:5px; /* Saf3-4 */border-radius:5px;-moz-box-shadow: 0 0 4px rgba(0, 0, 0, 0.2);-webkit-box-shadow: 0 0 4px rgba(0, 0, 0, 0.2);font-size:12px'>\
                                    <tr>\
                                     <td colspan='4' style='padding:18px 28px 18px; text-align:center;border-top:1px solid #e0e0e0; border-right:1px solid #e0e0e0;background: -moz-linear-gradient(100% 25% 90deg, #fefefe, #f9f9f9);background: -webkit-gradient(linear, 0% 0%, 0% 25%, from(#f9f9f9), to(#fefefe)); background:#e8eaeb;'>\
                                         <strong>INFORMACION DEL PACIENTE</strong>\
                                     </td>\
                                     </tr>\
                                     <tr>\
                                     <td colspan='4' style='padding:18px 28px 18px; text-align:center;border-top:1px solid #e0e0e0; border-right:1px solid #e0e0e0;background: -moz-linear-gradient(100% 25% 90deg, #fefefe, #f9f9f9);background: -webkit-gradient(linear, 0% 0%, 0% 25%, from(#f9f9f9), to(#fefefe));'>"
                                     + "<font color='#6E6E6E'>"  + fecha + "</font>" + 
                                     "</td>\
                                     </tr>\
                                     <tr>\
                                     <td style='padding:18px 28px 18px;border-top:1px solid #e0e0e0; border-right:1px solid #e0e0e0;background: -moz-linear-gradient(100% 25% 90deg, #fefefe, #f9f9f9);background: -webkit-gradient(linear, 0% 0%, 0% 25%, from(#f9f9f9), to(#fefefe));'>\
                                         <i>Nombres</i>\
                                     </td>\
                                     <td style='padding:18px 28px 18px; text-align:center;border-top:1px solid #e0e0e0; border-right:1px solid #e0e0e0;background: -moz-linear-gradient(100% 25% 90deg, #fefefe, #f9f9f9);background: -webkit-gradient(linear, 0% 0%, 0% 25%, from(#f9f9f9), to(#fefefe));'>"
                                     + "<font color='#6E6E6E'>"  + nombres + " " + nombres2 + "</font>" +
                                     "</td>\
                                     \
                                     \
                                     <td style='padding:18px 28px 18px;border-top:1px solid #e0e0e0; border-right:1px solid #e0e0e0;background: -moz-linear-gradient(100% 25% 90deg, #fefefe, #f9f9f9);background: -webkit-gradient(linear, 0% 0%, 0% 25%, from(#f9f9f9), to(#fefefe));'>\
                                         <i>Apellidos</i>\
                                     </td>\
                                     <td style='padding:18px 28px 18px; text-align:center;border-top:1px solid #e0e0e0; border-right:1px solid #e0e0e0;background: -moz-linear-gradient(100% 25% 90deg, #fefefe, #f9f9f9);background: -webkit-gradient(linear, 0% 0%, 0% 25%, from(#f9f9f9), to(#fefefe));'>"
                                     + "<font color='#6E6E6E'>"  + apellido + " " + apellido2 + "</font>" + 
                                     "</td>\
                                     </tr>\
                                     <tr>\
                                     <td style='padding:18px 28px 18px;border-top:1px solid #e0e0e0; border-right:1px solid #e0e0e0;background: -moz-linear-gradient(100% 25% 90deg, #fefefe, #f9f9f9);background: -webkit-gradient(linear, 0% 0%, 0% 25%, from(#f9f9f9), to(#fefefe));'>\
                                         <i>Documento</i>\
                                     </td>\
                                     <td style='padding:18px 28px 18px; text-align:center;border-top:1px solid #e0e0e0; border-right:1px solid #e0e0e0;background: -moz-linear-gradient(100% 25% 90deg, #fefefe, #f9f9f9);background: -webkit-gradient(linear, 0% 0%, 0% 25%, from(#f9f9f9), to(#fefefe));'>"
                                     + "<font color='#6E6E6E'>"  + documento + "</font>" +
                                     "</td>\
                                     \
                                     \
                                     <td style='padding:18px 28px 18px;border-top:1px solid #e0e0e0; border-right:1px solid #e0e0e0;background: -moz-linear-gradient(100% 25% 90deg, #fefefe, #f9f9f9);background: -webkit-gradient(linear, 0% 0%, 0% 25%, from(#f9f9f9), to(#fefefe));'>\
                                         <i>Servicio</i>\
                                     </td>\
                                     <td style='padding:18px 28px 18px; text-align:center;border-top:1px solid #e0e0e0; border-right:1px solid #e0e0e0;background: -moz-linear-gradient(100% 25% 90deg, #fefefe, #f9f9f9);background: -webkit-gradient(linear, 0% 0%, 0% 25%, from(#f9f9f9), to(#fefefe));'>"
                                     + "<font color='#6E6E6E'>"  + servicio + "</font>" + 
                                     "</td>\
                                     </tr>\
                                     <tr>\
                                     <td style='padding:18px 28px 18px;border-top:1px solid #e0e0e0; border-right:1px solid #e0e0e0;background: -moz-linear-gradient(100% 25% 90deg, #fefefe, #f9f9f9);background: -webkit-gradient(linear, 0% 0%, 0% 25%, from(#f9f9f9), to(#fefefe));'>\
                                         <i>Grupo Sanguineo</i>\
                                     </td>\
                                     <td style='padding:18px 28px 18px; text-align:center;border-top:1px solid #e0e0e0; border-right:1px solid #e0e0e0;background: -moz-linear-gradient(100% 25% 90deg, #fefefe, #f9f9f9);background: -webkit-gradient(linear, 0% 0%, 0% 25%, from(#f9f9f9), to(#fefefe));'>"
                                     + "<font color='#6E6E6E'>"  + grupos + "</font>" +
                                     "</td>\
                                     \
                                     \
                                     <td style='padding:18px 28px 18px;border-top:1px solid #e0e0e0; border-right:1px solid #e0e0e0;background: -moz-linear-gradient(100% 25% 90deg, #fefefe, #f9f9f9);background: -webkit-gradient(linear, 0% 0%, 0% 25%, from(#f9f9f9), to(#fefefe));'>\
                                         <i>Componente</i>\
                                     </td>\
                                     <td style='padding:18px 28px 18px; text-align:center;border-top:1px solid #e0e0e0; border-right:1px solid #e0e0e0;background: -moz-linear-gradient(100% 25% 90deg, #fefefe, #f9f9f9);background: -webkit-gradient(linear, 0% 0%, 0% 25%, from(#f9f9f9), to(#fefefe));'>"
                                     + "<font color='#6E6E6E'>"  + compo + "</font>" + 
                                     "</td>\
                                     </tr>\
                                     <tr>\
                                     <td style='padding:18px 28px 18px;border-top:1px solid #e0e0e0; border-right:1px solid #e0e0e0;background: -moz-linear-gradient(100% 25% 90deg, #fefefe, #f9f9f9);background: -webkit-gradient(linear, 0% 0%, 0% 25%, from(#f9f9f9), to(#fefefe));'>\
                                         <i>Rastreo Anticuerpos</i>\
                                     </td>\
                                     <td style='padding:18px 28px 18px; text-align:center;border-top:1px solid #e0e0e0; border-right:1px solid #e0e0e0;background: -moz-linear-gradient(100% 25% 90deg, #fefefe, #f9f9f9);background: -webkit-gradient(linear, 0% 0%, 0% 25%, from(#f9f9f9), to(#fefefe));'>"
                                     + "<font color='#6E6E6E'>"  + rai1 + "</font>" +
                                     "</td>\
                                     \
                                     \
                                     <td style='padding:18px 28px 18px;border-top:1px solid #e0e0e0; border-right:1px solid #e0e0e0;background: -moz-linear-gradient(100% 25% 90deg, #fefefe, #f9f9f9);background: -webkit-gradient(linear, 0% 0%, 0% 25%, from(#f9f9f9), to(#fefefe));'>\
                                         <i>Autocontrol</i>\
                                     </td>\
                                     <td style='padding:18px 28px 18px; text-align:center;border-top:1px solid #e0e0e0; border-right:1px solid #e0e0e0;background: -moz-linear-gradient(100% 25% 90deg, #fefefe, #f9f9f9);background: -webkit-gradient(linear, 0% 0%, 0% 25%, from(#f9f9f9), to(#fefefe));'>"
                                     + "<font color='#6E6E6E'>"  + autocontrol + "</font>" + 
                                     "</td>\
                                     </tr>\
                                     <tr>\
                                     <td colspan='4' style='padding:18px 28px 18px; text-align:center;border-top:1px solid #e0e0e0; border-right:1px solid #e0e0e0;background: -moz-linear-gradient(100% 25% 90deg, #fefefe, #f9f9f9);background: -webkit-gradient(linear, 0% 0%, 0% 25%, from(#f9f9f9), to(#fefefe)); background:#e8eaeb;'>\
                                         <strong>INFORMACION UNIDAD TRANSFUSIONAL</strong>\
                                     </td>\
                                     </tr>\
                                     <tr>\
                                     <td style='padding:18px 28px 18px;border-top:1px solid #e0e0e0; border-right:1px solid #e0e0e0;background: -moz-linear-gradient(100% 25% 90deg, #fefefe, #f9f9f9);background: -webkit-gradient(linear, 0% 0%, 0% 25%, from(#f9f9f9), to(#fefefe));'>\
                                         <i>Numero Sello</i>\
                                     </td>\
                                     <td style='padding:18px 28px 18px; text-align:center;border-top:1px solid #e0e0e0; border-right:1px solid #e0e0e0;background: -moz-linear-gradient(100% 25% 90deg, #fefefe, #f9f9f9);background: -webkit-gradient(linear, 0% 0%, 0% 25%, from(#f9f9f9), to(#fefefe));'>"
                                     + "<font color='#6E6E6E'>" + nums + "</font>" + 
                                     "</td>\
                                     \
                                     \
                                     <td style='padding:18px 28px 18px;border-top:1px solid #e0e0e0; border-right:1px solid #e0e0e0;background: -moz-linear-gradient(100% 25% 90deg, #fefefe, #f9f9f9);background: -webkit-gradient(linear, 0% 0%, 0% 25%, from(#f9f9f9), to(#fefefe));'>\
                                         <i>Grupo Sanguineo Unidad</i>\
                                     </td>\
                                     <td style='padding:18px 28px 18px; text-align:center;border-top:1px solid #e0e0e0; border-right:1px solid #e0e0e0;background: -moz-linear-gradient(100% 25% 90deg, #fefefe, #f9f9f9);background: -webkit-gradient(linear, 0% 0%, 0% 25%, from(#f9f9f9), to(#fefefe));'>"
                                     + "<font color='#6E6E6E'>" + gruposu + "</font>" + 
                                     "</td>\
                                     \
                                     \
                                     <tr>\
                                     <td style='padding:18px 28px 18px;border-top:1px solid #e0e0e0; border-right:1px solid #e0e0e0;background: -moz-linear-gradient(100% 25% 90deg, #fefefe, #f9f9f9);background: -webkit-gradient(linear, 0% 0%, 0% 25%, from(#f9f9f9), to(#fefefe));'>\
                                         <i>Prueba Cruzada</i>\
                                     </td>\
                                     <td style='padding:18px 28px 18px; text-align:center;border-top:1px solid #e0e0e0; border-right:1px solid #e0e0e0;background: -moz-linear-gradient(100% 25% 90deg, #fefefe, #f9f9f9);background: -webkit-gradient(linear, 0% 0%, 0% 25%, from(#f9f9f9), to(#fefefe));'>"
                                     + "<font color='#6E6E6E'>" + pruebac + "</font>" +
                                     "</td>\
                                     \
                                     \
                                     <td style='padding:18px 28px 18px;border-top:1px solid #e0e0e0; border-right:1px solid #e0e0e0;background: -moz-linear-gradient(100% 25% 90deg, #fefefe, #f9f9f9);background: -webkit-gradient(linear, 0% 0%, 0% 25%, from(#f9f9f9), to(#fefefe));'>\
                                         <i>Bact. Responsable</i>\
                                     </td>\
                                     <td style='padding:18px 28px 18px; text-align:center;border-top:1px solid #e0e0e0; border-right:1px solid #e0e0e0;background: -moz-linear-gradient(100% 25% 90deg, #fefefe, #f9f9f9);background: -webkit-gradient(linear, 0% 0%, 0% 25%, from(#f9f9f9), to(#fefefe));'>"
                                     + "<font color='#6E6E6E'>" + bacres + "</font>" +
                                     "</td>\
                                     </tr>\
                                     <tr>\
                                     <td style='padding:18px 28px 18px;border-top:1px solid #e0e0e0; border-right:1px solid #e0e0e0;background: -moz-linear-gradient(100% 25% 90deg, #fefefe, #f9f9f9);background: -webkit-gradient(linear, 0% 0%, 0% 25%, from(#f9f9f9), to(#fefefe));'>\
                                         <i>Temperatura Unidad</i>\
                                     </td>\
                                     <td style='padding:18px 28px 18px; text-align:center;border-top:1px solid #e0e0e0; border-right:1px solid #e0e0e0;background: -moz-linear-gradient(100% 25% 90deg, #fefefe, #f9f9f9);background: -webkit-gradient(linear, 0% 0%, 0% 25%, from(#f9f9f9), to(#fefefe));'>"
                                     + "<font color='#6E6E6E'>" + temp + "ºC"  +"</font>" +
                                     "</td>\
                                     \
                                     \
                                     <td style='padding:18px 28px 18px;border-top:1px solid #e0e0e0; border-right:1px solid #e0e0e0;background: -moz-linear-gradient(100% 25% 90deg, #fefefe, #f9f9f9);background: -webkit-gradient(linear, 0% 0%, 0% 25%, from(#f9f9f9), to(#fefefe));'>\
                                         <i>Esatado Unidad</i>\
                                     </td>\
                                     <td style='padding:18px 28px 18px; text-align:center;border-top:1px solid #e0e0e0; border-right:1px solid #e0e0e0;background: -moz-linear-gradient(100% 25% 90deg, #fefefe, #f9f9f9);background: -webkit-gradient(linear, 0% 0%, 0% 25%, from(#f9f9f9), to(#fefefe));'>"
                                     + "<font color='#6E6E6E'>" + estado +"</font>" +
                                     "</td>\
                                     </tr>\
                                     <tr>\
                                     \
                                     <td style='padding:18px 28px 18px;border-top:1px solid #e0e0e0; border-right:1px solid #e0e0e0;background: -moz-linear-gradient(100% 25% 90deg, #fefefe, #f9f9f9);background: -webkit-gradient(linear, 0% 0%, 0% 25%, from(#f9f9f9), to(#fefefe));'>\
                                         <i>Orientador</i>\
                                     </td>\
                                     <td style='padding:18px 28px 18px; text-align:center;border-top:1px solid #e0e0e0; border-right:1px solid #e0e0e0;background: -moz-linear-gradient(100% 25% 90deg, #fefefe, #f9f9f9);background: -webkit-gradient(linear, 0% 0%, 0% 25%, from(#f9f9f9), to(#fefefe));'>"
                                     + "<font color='#6E6E6E'>" + orientador +"</font>" +
                                     "</td>\
                                     <td style='padding:18px 28px 18px;border-top:1px solid #e0e0e0; border-right:1px solid #e0e0e0;background: -moz-linear-gradient(100% 25% 90deg, #fefefe, #f9f9f9);background: -webkit-gradient(linear, 0% 0%, 0% 25%, from(#f9f9f9), to(#fefefe));'>\
                                         <i>Numero Nevera</i>\
                                     </td>\
                                     <td style='padding:18px 28px 18px; text-align:center;border-top:1px solid #e0e0e0; border-right:1px solid #e0e0e0;background: -moz-linear-gradient(100% 25% 90deg, #fefefe, #f9f9f9);background: -webkit-gradient(linear, 0% 0%, 0% 25%, from(#f9f9f9), to(#fefefe));'>"
                                     + "<font color='#6E6E6E'>" + numn +"</font>" +
                                     "</td>\
                                     </tr>\
                                     </table></br></br>");
               //document.getElementById("numS").value="";
               $("#oidb").attr("value",oidb);
               
               
               editarDatos();
               //cargarPac();
            }
            
            function unidades(){
                
            }
            
            function mostrarUnid(){
                
            }
            
        </script>
        <script>
            function editarDatos(){
                
                var oidbi = $("#oidb").val();
                
                $.ajax({
                    async: true,
                    type: "POST",
                    dataType: "json",
                    contentType: "application/x-www-form-urlencoded; charset=UTF-8",
                    url: "../../Laboratorio/controlador/php/sql/ediBitac.php",
                    data: {oidbi:oidbi},
                    success: mostrarM
                });

            }
            
            function mostrarM(men){
                if(men.mensaje === "1"){
                    document.getElementById("respuesta").innerHTML = "";
                    alertify.error("La unidad ya se recibio, por favor consulte");
                }else{
                    
                }
            }
            
            
        </script>
        
        <style>
            #signos{
                border-radius: 5px;
                color: #606060;
                border: solid 1px #b7b7b7;
                background: #fff;
                background: -webkit-gradient(linear, left top, left bottom, from(#fff), to(#ededed));
                background: -moz-linear-gradient(top,  #fff,  #ededed);
                filter:  progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffff', endColorstr='#ededed');
                padding: 4px 4px 4px;
                height: 30px;
                font-size: 13px;
            }

            #signos:hover{
                 background: #ededed;
                 background: -webkit-gradient(linear, left top, left bottom, from(#fff), to(#dcdcdc));
                 background: -moz-linear-gradient(top,  #fff,  #dcdcdc);
                 filter:  progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffff', endColorstr='#dcdcdc');
            }
            #signos:active{
                color: #999;
                background: -webkit-gradient(linear, left top, left bottom, from(#ededed), to(#fff));
                background: -moz-linear-gradient(top,  #ededed,  #fff);
                filter:  progid:DXImageTransform.Microsoft.gradient(startColorstr='#ededed', endColorstr='#ffffff');
            }
            
            #nuevos{
                border-radius: 5px;
                color: #606060;
                border: solid 1px #b7b7b7;
                background: #fff;
                background: -webkit-gradient(linear, left top, left bottom, from(#fff), to(#ededed));
                background: -moz-linear-gradient(top,  #fff,  #ededed);
                filter:  progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffff', endColorstr='#ededed');
                padding: 4px 4px 4px;
                height: 30px;
                font-size: 13px;
            }

            #nuevos:hover{
                background: #ededed;
                background: -webkit-gradient(linear, left top, left bottom, from(#fff), to(#dcdcdc));
                background: -moz-linear-gradient(top,  #fff,  #dcdcdc);
                filter:  progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffff', endColorstr='#dcdcdc');
            }
            #nuevos:active{
                color: #999;
                background: -webkit-gradient(linear, left top, left bottom, from(#ededed), to(#fff));
                background: -moz-linear-gradient(top,  #ededed,  #fff);
                filter:  progid:DXImageTransform.Microsoft.gradient(startColorstr='#ededed', endColorstr='#ffffff');
            }
            
            #buscador{
                background-image: url(../imagen/ses/consulta.jpg);
                background-repeat: no-repeat;
                height: 26px;
                width: 25px;
                cursor: pointer;
                -webkit-border-radius: 10px;
                -moz-border-radius: 20px;
                border-radius: 20px;
            }
        </style>
        <style type="text/css"> 
            #tabs, #ui-datepicker-div, .ui-datepicker{ font-size: 85%; }	
	</style> 
        <script type="text/javascript">
			
            $(function(){
                    $('#tabs').tabs();

                    $('.example-container > pre').each(function(i){
                            eval($(this).text());
                    });
            });

        </script>
        <script>
            function enviarC(){
                if($("#numS").val() === ""){
                    alertify.alert(" DEBE REGISTRAR EL NUMERO DE SELLO DE LA UNIDAD", function () {
                        $("#numS").focus();
                    });
                    return false;
                }
                
                if($("#cants").val() === ""){
                    alertify.alert("DIGITE CANTIDAD SOLICITADA ", function () {
                        $("#cants").focus();
                    });
                    return false;
                }
                
                if($("#cante").val() === ""){
                    alertify.alert("DIGITE CANTIDAD RECIBIDA ", function () {
                        $("#cante").focus();
                    });
                    return false;
                }
                
                if($("#teml").val() === ""){
                    alertify.alert("DIGITE TEMPERATURA DE LLEGA ", function () {
                        $("#teml").focus();
                    });
                    return false;
                }
                if($("#hora1").val() === ""){
                    alertify.alert("INGRESE LA HORA DE INICIO DE LA TRANSFUSION ", function () {
                        $("#hora1").focus();
                    });
                    return false;
                }
                if($("#hora").val() === ""){
                    alertify.alert("INGRESE LA HORA FIN DE LA TRANSFUSION ", function () {
                        $("#hora").focus();
                    });
                    return false;
                }
                
                if($("#medi").val() === ""){
                    alertify.alert(" POR FAVOR INGRESE EL MEDICO RESPONSABLE ", function () {
                        $("#medi").focus();
                    });
                    return false;
                }
                
                //validar orden
                
                            if($("#ta").val() === ""  && $("#ta15").val() !== ""){
                               alertify.alert("OPERACION INVALIDA, POR FAVOR INGRESE LOS SIGNOS VITALES ANTES DE LA TRANSFUSION", function () {
                                    $("#ta").focus();
                                });
                                return false;
                            } 

                           if($("#ta").val() === ""  && $("#t15").val() !== ""){
                               alertify.alert("OPERACION INVALIDA, POR FAVOR INGRESE LOS SIGNOS VITALES ANTES DE LA TRANSFUSION", function () {
                                    $("#ta").focus();
                                });
                                return false;
                            } 
                            if($("#ta").val() === ""  && $("#fc15").val() !== ""){
                               alertify.alert("OPERACION INVALIDA, POR FAVOR INGRESE LOS SIGNOS VITALES ANTES DE LA TRANSFUSION", function () {
                                    $("#ta").focus();
                                });
                                return false;
                            } 
                            if($("#ta").val() === ""  && $("#fr15").val() !== ""){
                               alertify.alert("OPERACION INVALIDA, POR FAVOR INGRESE LOS SIGNOS VITALES ANTES DE LA TRANSFUSION", function () {
                                    $("#ta").focus();
                                });
                                return false;
                            }
                            if($("#ta").val() === ""  && $("#so15").val() !== ""){
                               alertify.alert("OPERACION INVALIDA, POR FAVOR INGRESE LOS SIGNOS VITALES ANTES DE LA TRANSFUSION", function () {
                                    $("#ta").focus();
                                });
                                return false;
                            } 
                            
                            
                            if($("#ta").val() === ""  && $("#ta30").val() !== ""){
                               alertify.alert("OPERACION INVALIDA, POR FAVOR INGRESE LOS SIGNOS VITALES ANTES DE LA TRANSFUSION", function () {
                                    $("#ta").focus();
                                });
                                return false;
                            } 

                           if($("#ta").val() === ""  && $("#t30").val() !== ""){
                               alertify.alert("OPERACION INVALIDA, POR FAVOR INGRESE LOS SIGNOS VITALES ANTES DE LA TRANSFUSION", function () {
                                    $("#ta").focus();
                                });
                                return false;
                            } 
                            if($("#ta").val() === ""  && $("#fc30").val() !== ""){
                               alertify.alert("OPERACION INVALIDA, POR FAVOR INGRESE LOS SIGNOS VITALES ANTES DE LA TRANSFUSION", function () {
                                    $("#ta").focus();
                                });
                                return false;
                            } 
                            if($("#ta").val() === ""  && $("#fr30").val() !== ""){
                               alertify.alert("OPERACION INVALIDA, POR FAVOR INGRESE LOS SIGNOS VITALES ANTES DE LA TRANSFUSION", function () {
                                    $("#ta").focus();
                                });
                                return false;
                            }
                            if($("#ta").val() === ""  && $("#so30").val() !== ""){
                               alertify.alert("OPERACION INVALIDA, POR FAVOR INGRESE LOS SIGNOS VITALES ANTES DE LA TRANSFUSION", function () {
                                    $("#ta").focus();
                                });
                                return false;
                            }
                            if($("#ta").val() === ""  && $("#ta60").val() !== ""){
                               alertify.alert("OPERACION INVALIDA, POR FAVOR INGRESE LOS SIGNOS VITALES ANTES DE LA TRANSFUSION", function () {
                                    $("#ta").focus();
                                });
                                return false;
                            }
                            if($("#ta").val() === ""  && $("#ta1h").val() !== ""){
                               alertify.alert("OPERACION INVALIDA, POR FAVOR INGRESE LOS SIGNOS VITALES ANTES DE LA TRANSFUSION", function () {
                                    $("#ta").focus();
                                });
                                return false;
                            }
                            if($("#ta").val() === ""  && $("#so1h").val() !== ""){
                               alertify.alert("OPERACION INVALIDA, POR FAVOR INGRESE LOS SIGNOS VITALES ANTES DE LA TRANSFUSION", function () {
                                    $("#ta").focus();
                                });
                                return false;
                            }
                            
                            
                //se termina la validacion
                
               if(document.getElementById("r15").checked === true && document.getElementById("obs15").value === ""){
                   alertify.alert("POR FAVOR DESCRIBA LA REACCION DEL PACIENTE", function () {
                        $("#obs15").focus();
                    });
                    return false;
                } 
                
                if(document.getElementById("r30").checked === true && document.getElementById("obs30").value === ""){
                   alertify.alert("POR FAVOR DESCRIBA LA REACCION DEL PACIENTE", function () {
                        $("#obs30").focus();
                    });
                    return false;
                }
                
                if(document.getElementById("r60").checked === true && document.getElementById("obs60").value === ""){
                   alertify.alert("POR FAVOR DESCRIBA LA REACCION DEL PACIENTE", function () {
                        $("#obs60").focus();
                    });
                    return false;
                }
                
                if(document.getElementById("r1h").checked === true && document.getElementById("obs1h").value === ""){
                   alertify.alert("POR FAVOR DESCRIBA LA REACCION DEL PACIENTE", function () {
                        $("#obs1h").focus();
                    });
                    return false;
                }
                
                
                alertify.confirm("<p>ESTA SEGURO DE GUARDAR LOS DATOS</p>", function (e) {
                if (e) {
                   $('#controlt').attr('action', '../../Laboratorio/controlador/php/sql/insertarControl.php');
                    $("#controlt").submit();
                } else { 
                    
                }
                }); 
                return false;
            }
            
            function ordenS(){
               if($("#ta").val() === ""){
                   alertify.alert("OPERACION INVALIDA, POR FAVOR INGRESE LOS SIGNOS VITALES ANTES DE LA TRANSFUSION", function () {
                        $("#ta").focus();
                    });
                    return false;
               } 
            }
        </script>
        <script>
            function buscarU(){
                    window.open("busquedaU.php","","width=300,height=100,scrollbars=yes");
            }
            
            function buscarM(){
                window.open("../../Laboratorio/vista/php/buscarM.php","","width=500,height=390,scrollbars=yes");
            }
            
        </script>
        
        
         <script>
            function datosUni2(){
                
                var codUnidad = $("#numse").val();
                $.ajax({
                    type: "POST",
                    contentType: "application/x-www-form-urlencoded; charset=UTF-8",
                    url: "../../Laboratorio/controlador/php/sql/datosUni.php",
                    data: {codUnidad:codUnidad,tc:1},
                    success: mostrarDU2,
                    timeout: 4000,
                    error: errorEnvio2
                });
            }
            
            
            function errorEnvio2() {
                    alert("error consulta");
                }
            
            
            function mostrarDU2(respuesta){
              
                rpt = $.parseJSON(respuesta);
                respuesta = $("#respuesta");
                var resp = "";
                
             /* if(rpt == null){
                    alertify.error("No se encuentran datos de la unidad..."); 
                    return false;
                }*/
        
        
                //Se valida si no se encuentran datos del paciente
                if(rpt == null){
                    
                    alertify.error("No se encuentran datos de la unidad...");
                    
                }else{
                    
                    for(dato in rpt){
                   
                    document.getElementById("ingreso").value= rpt[dato].adnIngreso;
                    var servicio  = rpt[dato].ser_descripcion;
                    var componente  = rpt[dato].ltr_componente;
                    var grupos  = rpt[dato].ltr_grupoS;
                    var tamizaje  = rpt[dato].ltr_tamizaje;
                    var numu  = rpt[dato].ltr_numU;
                    var nums  = rpt[dato].ltr_numSe;
                    var fechav  = rpt[dato].ltr_fechaV;
                    var gruposu  = rpt[dato].ltr_gruposu;
                    var rai1  = rpt[dato].ltr_rai1;
                    var rai2  = rpt[dato].ltr_rai2;
                    var autocontrol  = rpt[dato].ltr_autoC;
                    var pruebac  = rpt[dato].ltr_pruebC;
                    var bacres  = rpt[dato].usu_nombres + " " + rpt[dato].usu_apellidos;
                    var nombres  = rpt[dato].PACPRINOM;
                    var nombres2  = rpt[dato].PACSEGNOM;
                    var apellido  = rpt[dato].PACPRIAPE;
                    var apellido2  = rpt[dato].PACSEGAPE;
                    var documento  = rpt[dato].PACNUMDOC;
                    var temp  = rpt[dato].ltr_tempS;
                    var estado  = rpt[dato].ltr_estadoU;
                    var fecha = rpt[dato].ltr_fecha;
                    var orientador = rpt[dato].ltr_qrecibe;
                    var oidb = rpt[dato].ltr_oid;
                    var numn = rpt[dato].ltr_numN;

                }
                    if(componente === "pqm"){
                         var compo = "PLAQ MANUAL";
                     }else if(componente=== "grpl"){
                         compo = "GRPL";
                     }else if(componente=== "grf"){
                         compo = "GRF";
                     }else if(componente === "pfc"){
                         compo = "PFC";
                     }else if(componente === "cro"){
                         compo = "CRIO";
                     }else if(componente === "pqa"){
                         compo = "PLAQ POR AF";
                     }

                $("#respuesta").html("<table style='overflow:hidden;border:1px solid #d3d3d3;background:#fefefe;width:70%;-moz-border-radius:5px; /* FF1+ */-webkit-border-radius:5px; /* Saf3-4 */border-radius:5px;-moz-box-shadow: 0 0 4px rgba(0, 0, 0, 0.2);-webkit-box-shadow: 0 0 4px rgba(0, 0, 0, 0.2);font-size:12px'>\
                                     <tr>\
                                      <td colspan='4' style='padding:18px 28px 18px; text-align:center;border-top:1px solid #e0e0e0; border-right:1px solid #e0e0e0;background: -moz-linear-gradient(100% 25% 90deg, #fefefe, #f9f9f9);background: -webkit-gradient(linear, 0% 0%, 0% 25%, from(#f9f9f9), to(#fefefe)); background:#e8eaeb;'>\
                                          <strong>INFORMACION DEL PACIENTE</strong>\
                                      </td>\
                                      </tr>\
                                      <tr>\
                                      <td colspan='4' style='padding:18px 28px 18px; text-align:center;border-top:1px solid #e0e0e0; border-right:1px solid #e0e0e0;background: -moz-linear-gradient(100% 25% 90deg, #fefefe, #f9f9f9);background: -webkit-gradient(linear, 0% 0%, 0% 25%, from(#f9f9f9), to(#fefefe));'>"
                                      + "<font color='#6E6E6E'>"  + fecha + "</font>" + 
                                      "</td>\
                                      </tr>\
                                      <tr>\
                                      <td style='padding:18px 28px 18px;border-top:1px solid #e0e0e0; border-right:1px solid #e0e0e0;background: -moz-linear-gradient(100% 25% 90deg, #fefefe, #f9f9f9);background: -webkit-gradient(linear, 0% 0%, 0% 25%, from(#f9f9f9), to(#fefefe));'>\
                                          <i>Nombres</i>\
                                      </td>\
                                      <td style='padding:18px 28px 18px; text-align:center;border-top:1px solid #e0e0e0; border-right:1px solid #e0e0e0;background: -moz-linear-gradient(100% 25% 90deg, #fefefe, #f9f9f9);background: -webkit-gradient(linear, 0% 0%, 0% 25%, from(#f9f9f9), to(#fefefe));'>"
                                      + "<font color='#6E6E6E'>"  + nombres + " " + nombres2 + "</font>" +
                                      "</td>\
                                      \
                                      \
                                      <td style='padding:18px 28px 18px;border-top:1px solid #e0e0e0; border-right:1px solid #e0e0e0;background: -moz-linear-gradient(100% 25% 90deg, #fefefe, #f9f9f9);background: -webkit-gradient(linear, 0% 0%, 0% 25%, from(#f9f9f9), to(#fefefe));'>\
                                          <i>Apellidos</i>\
                                      </td>\
                                      <td style='padding:18px 28px 18px; text-align:center;border-top:1px solid #e0e0e0; border-right:1px solid #e0e0e0;background: -moz-linear-gradient(100% 25% 90deg, #fefefe, #f9f9f9);background: -webkit-gradient(linear, 0% 0%, 0% 25%, from(#f9f9f9), to(#fefefe));'>"
                                      + "<font color='#6E6E6E'>"  + apellido + " " + apellido2 + "</font>" + 
                                      "</td>\
                                      </tr>\
                                      <tr>\
                                      <td style='padding:18px 28px 18px;border-top:1px solid #e0e0e0; border-right:1px solid #e0e0e0;background: -moz-linear-gradient(100% 25% 90deg, #fefefe, #f9f9f9);background: -webkit-gradient(linear, 0% 0%, 0% 25%, from(#f9f9f9), to(#fefefe));'>\
                                          <i>Documento</i>\
                                      </td>\
                                      <td style='padding:18px 28px 18px; text-align:center;border-top:1px solid #e0e0e0; border-right:1px solid #e0e0e0;background: -moz-linear-gradient(100% 25% 90deg, #fefefe, #f9f9f9);background: -webkit-gradient(linear, 0% 0%, 0% 25%, from(#f9f9f9), to(#fefefe));'>"
                                      + "<font color='#6E6E6E'>"  + documento + "</font>" +
                                      "</td>\
                                      \
                                      \
                                      <td style='padding:18px 28px 18px;border-top:1px solid #e0e0e0; border-right:1px solid #e0e0e0;background: -moz-linear-gradient(100% 25% 90deg, #fefefe, #f9f9f9);background: -webkit-gradient(linear, 0% 0%, 0% 25%, from(#f9f9f9), to(#fefefe));'>\
                                          <i>Servicio</i>\
                                      </td>\
                                      <td style='padding:18px 28px 18px; text-align:center;border-top:1px solid #e0e0e0; border-right:1px solid #e0e0e0;background: -moz-linear-gradient(100% 25% 90deg, #fefefe, #f9f9f9);background: -webkit-gradient(linear, 0% 0%, 0% 25%, from(#f9f9f9), to(#fefefe));'>"
                                      + "<font color='#6E6E6E'>"  + servicio + "</font>" + 
                                      "</td>\
                                      </tr>\
                                      <tr>\
                                      <td style='padding:18px 28px 18px;border-top:1px solid #e0e0e0; border-right:1px solid #e0e0e0;background: -moz-linear-gradient(100% 25% 90deg, #fefefe, #f9f9f9);background: -webkit-gradient(linear, 0% 0%, 0% 25%, from(#f9f9f9), to(#fefefe));'>\
                                          <i>Grupo Sanguineo</i>\
                                      </td>\
                                      <td style='padding:18px 28px 18px; text-align:center;border-top:1px solid #e0e0e0; border-right:1px solid #e0e0e0;background: -moz-linear-gradient(100% 25% 90deg, #fefefe, #f9f9f9);background: -webkit-gradient(linear, 0% 0%, 0% 25%, from(#f9f9f9), to(#fefefe));'>"
                                      + "<font color='#6E6E6E'>"  + grupos + "</font>" +
                                      "</td>\
                                      \
                                      \
                                      <td style='padding:18px 28px 18px;border-top:1px solid #e0e0e0; border-right:1px solid #e0e0e0;background: -moz-linear-gradient(100% 25% 90deg, #fefefe, #f9f9f9);background: -webkit-gradient(linear, 0% 0%, 0% 25%, from(#f9f9f9), to(#fefefe));'>\
                                          <i>Componente</i>\
                                      </td>\
                                      <td style='padding:18px 28px 18px; text-align:center;border-top:1px solid #e0e0e0; border-right:1px solid #e0e0e0;background: -moz-linear-gradient(100% 25% 90deg, #fefefe, #f9f9f9);background: -webkit-gradient(linear, 0% 0%, 0% 25%, from(#f9f9f9), to(#fefefe));'>"
                                      + "<font color='#6E6E6E'>"  + compo + "</font>" + 
                                      "</td>\
                                      </tr>\
                                      <tr>\
                                      <td style='padding:18px 28px 18px;border-top:1px solid #e0e0e0; border-right:1px solid #e0e0e0;background: -moz-linear-gradient(100% 25% 90deg, #fefefe, #f9f9f9);background: -webkit-gradient(linear, 0% 0%, 0% 25%, from(#f9f9f9), to(#fefefe));'>\
                                          <i>Rastreo Anticuerpos</i>\
                                      </td>\
                                      <td style='padding:18px 28px 18px; text-align:center;border-top:1px solid #e0e0e0; border-right:1px solid #e0e0e0;background: -moz-linear-gradient(100% 25% 90deg, #fefefe, #f9f9f9);background: -webkit-gradient(linear, 0% 0%, 0% 25%, from(#f9f9f9), to(#fefefe));'>"
                                      + "<font color='#6E6E6E'>"  + rai1 + "</font>" +
                                      "</td>\
                                      \
                                      \
                                      <td style='padding:18px 28px 18px;border-top:1px solid #e0e0e0; border-right:1px solid #e0e0e0;background: -moz-linear-gradient(100% 25% 90deg, #fefefe, #f9f9f9);background: -webkit-gradient(linear, 0% 0%, 0% 25%, from(#f9f9f9), to(#fefefe));'>\
                                          <i>Autocontrol</i>\
                                      </td>\
                                      <td style='padding:18px 28px 18px; text-align:center;border-top:1px solid #e0e0e0; border-right:1px solid #e0e0e0;background: -moz-linear-gradient(100% 25% 90deg, #fefefe, #f9f9f9);background: -webkit-gradient(linear, 0% 0%, 0% 25%, from(#f9f9f9), to(#fefefe));'>"
                                      + "<font color='#6E6E6E'>"  + autocontrol + "</font>" + 
                                      "</td>\
                                      </tr>\
                                      <tr>\
                                      <td colspan='4' style='padding:18px 28px 18px; text-align:center;border-top:1px solid #e0e0e0; border-right:1px solid #e0e0e0;background: -moz-linear-gradient(100% 25% 90deg, #fefefe, #f9f9f9);background: -webkit-gradient(linear, 0% 0%, 0% 25%, from(#f9f9f9), to(#fefefe)); background:#e8eaeb;'>\
                                          <strong>INFORMACION UNIDAD TRANSFUSIONAL</strong>\
                                      </td>\
                                      </tr>\
                                      <tr>\
                                      <td style='padding:18px 28px 18px;border-top:1px solid #e0e0e0; border-right:1px solid #e0e0e0;background: -moz-linear-gradient(100% 25% 90deg, #fefefe, #f9f9f9);background: -webkit-gradient(linear, 0% 0%, 0% 25%, from(#f9f9f9), to(#fefefe));'>\
                                          <i>Numero Sello</i>\
                                      </td>\
                                      <td style='padding:18px 28px 18px; text-align:center;border-top:1px solid #e0e0e0; border-right:1px solid #e0e0e0;background: -moz-linear-gradient(100% 25% 90deg, #fefefe, #f9f9f9);background: -webkit-gradient(linear, 0% 0%, 0% 25%, from(#f9f9f9), to(#fefefe));'>"
                                      + "<font color='#6E6E6E'>" + nums + "</font>" + 
                                      "</td>\
                                      \
                                      \
                                      <td style='padding:18px 28px 18px;border-top:1px solid #e0e0e0; border-right:1px solid #e0e0e0;background: -moz-linear-gradient(100% 25% 90deg, #fefefe, #f9f9f9);background: -webkit-gradient(linear, 0% 0%, 0% 25%, from(#f9f9f9), to(#fefefe));'>\
                                          <i>Grupo Sanguineo Unidad</i>\
                                      </td>\
                                      <td style='padding:18px 28px 18px; text-align:center;border-top:1px solid #e0e0e0; border-right:1px solid #e0e0e0;background: -moz-linear-gradient(100% 25% 90deg, #fefefe, #f9f9f9);background: -webkit-gradient(linear, 0% 0%, 0% 25%, from(#f9f9f9), to(#fefefe));'>"
                                      + "<font color='#6E6E6E'>" + gruposu + "</font>" + 
                                      "</td>\
                                      \
                                      \
                                      <tr>\
                                      <td style='padding:18px 28px 18px;border-top:1px solid #e0e0e0; border-right:1px solid #e0e0e0;background: -moz-linear-gradient(100% 25% 90deg, #fefefe, #f9f9f9);background: -webkit-gradient(linear, 0% 0%, 0% 25%, from(#f9f9f9), to(#fefefe));'>\
                                          <i>Prueba Cruzada</i>\
                                      </td>\
                                      <td style='padding:18px 28px 18px; text-align:center;border-top:1px solid #e0e0e0; border-right:1px solid #e0e0e0;background: -moz-linear-gradient(100% 25% 90deg, #fefefe, #f9f9f9);background: -webkit-gradient(linear, 0% 0%, 0% 25%, from(#f9f9f9), to(#fefefe));'>"
                                      + "<font color='#6E6E6E'>" + pruebac + "</font>" +
                                      "</td>\
                                      \
                                      \
                                      <td style='padding:18px 28px 18px;border-top:1px solid #e0e0e0; border-right:1px solid #e0e0e0;background: -moz-linear-gradient(100% 25% 90deg, #fefefe, #f9f9f9);background: -webkit-gradient(linear, 0% 0%, 0% 25%, from(#f9f9f9), to(#fefefe));'>\
                                          <i>Bact. Responsable</i>\
                                      </td>\
                                      <td style='padding:18px 28px 18px; text-align:center;border-top:1px solid #e0e0e0; border-right:1px solid #e0e0e0;background: -moz-linear-gradient(100% 25% 90deg, #fefefe, #f9f9f9);background: -webkit-gradient(linear, 0% 0%, 0% 25%, from(#f9f9f9), to(#fefefe));'>"
                                      + "<font color='#6E6E6E'>" + bacres + "</font>" +
                                      "</td>\
                                      </tr>\
                                      <tr>\
                                      <td style='padding:18px 28px 18px;border-top:1px solid #e0e0e0; border-right:1px solid #e0e0e0;background: -moz-linear-gradient(100% 25% 90deg, #fefefe, #f9f9f9);background: -webkit-gradient(linear, 0% 0%, 0% 25%, from(#f9f9f9), to(#fefefe));'>\
                                          <i>Temperatura Unidad</i>\
                                      </td>\
                                      <td style='padding:18px 28px 18px; text-align:center;border-top:1px solid #e0e0e0; border-right:1px solid #e0e0e0;background: -moz-linear-gradient(100% 25% 90deg, #fefefe, #f9f9f9);background: -webkit-gradient(linear, 0% 0%, 0% 25%, from(#f9f9f9), to(#fefefe));'>"
                                      + "<font color='#6E6E6E'>" + temp + "ºC"  +"</font>" +
                                      "</td>\
                                      \
                                      \
                                      <td style='padding:18px 28px 18px;border-top:1px solid #e0e0e0; border-right:1px solid #e0e0e0;background: -moz-linear-gradient(100% 25% 90deg, #fefefe, #f9f9f9);background: -webkit-gradient(linear, 0% 0%, 0% 25%, from(#f9f9f9), to(#fefefe));'>\
                                          <i>Esatado Unidad</i>\
                                      </td>\
                                      <td style='padding:18px 28px 18px; text-align:center;border-top:1px solid #e0e0e0; border-right:1px solid #e0e0e0;background: -moz-linear-gradient(100% 25% 90deg, #fefefe, #f9f9f9);background: -webkit-gradient(linear, 0% 0%, 0% 25%, from(#f9f9f9), to(#fefefe));'>"
                                      + "<font color='#6E6E6E'>" + estado +"</font>" +
                                      "</td>\
                                      <tr>\
                                      \
                                      <td style='padding:18px 28px 18px;border-top:1px solid #e0e0e0; border-right:1px solid #e0e0e0;background: -moz-linear-gradient(100% 25% 90deg, #fefefe, #f9f9f9);background: -webkit-gradient(linear, 0% 0%, 0% 25%, from(#f9f9f9), to(#fefefe));'>\
                                          <i>Orientador</i>\
                                      </td>\
                                      <td style='padding:18px 28px 18px; text-align:center;border-top:1px solid #e0e0e0; border-right:1px solid #e0e0e0;background: -moz-linear-gradient(100% 25% 90deg, #fefefe, #f9f9f9);background: -webkit-gradient(linear, 0% 0%, 0% 25%, from(#f9f9f9), to(#fefefe));'>"
                                      + "<font color='#6E6E6E'>" + orientador +"</font>" +
                                      "</td>\
                                      <td style='padding:18px 28px 18px;border-top:1px solid #e0e0e0; border-right:1px solid #e0e0e0;background: -moz-linear-gradient(100% 25% 90deg, #fefefe, #f9f9f9);background: -webkit-gradient(linear, 0% 0%, 0% 25%, from(#f9f9f9), to(#fefefe));'>\
                                          <i>Numero Nevera</i>\
                                      </td>\
                                      <td style='padding:18px 28px 18px; text-align:center;border-top:1px solid #e0e0e0; border-right:1px solid #e0e0e0;background: -moz-linear-gradient(100% 25% 90deg, #fefefe, #f9f9f9);background: -webkit-gradient(linear, 0% 0%, 0% 25%, from(#f9f9f9), to(#fefefe));'>"
                                      + "<font color='#6E6E6E'>" + numn +"</font>" +
                                      "</td>\
                                      </tr>\
                                      </table></br></br>");
                  $("#oidb").attr("value",oidb);
                  Datoscs();
                    
                }
               
            }
            
        </script>
        
        <script>
            function Datoscs(){
                var oidlt = $("#oidb").val();
                //alert(oidlt);
                $.ajax({
                    type: "POST",
                    contentType: "application/x-www-form-urlencoded; charset=UTF-8",
                    url: "../../Laboratorio/controlador/php/sql/datoscs.php",
                    data: {oidlt:oidlt},
                    success: mostrarcs,
                    timeout: 4000,
                    error: errorEnviocs
                });
            } 
            
            function errorEnviocs() {
                    alert("error consulta");
                }
            
            function mostrarcs(respuesta){
                rpt = $.parseJSON(respuesta);
                
                if(rpt == null){
                    $("#respuesta").text("");
                    alertify.error("No se encuentran datos de la unidad..."); 
                    return false;
                }
                
                for(dat in rpt){
                    document.getElementById("cants").value = rpt[dat].con_cants;
                    document.getElementById("cante").value = rpt[dat].con_cante;
                    document.getElementById("teml").value = rpt[dat].con_teml;
                    document.getElementById("hora1").value = rpt[dat].con_hi;
                    document.getElementById("hora").value = rpt[dat].con_hf;
                    
                    document.getElementById("ta").value = rpt[dat].sig_ta;
                    document.getElementById("t").value = rpt[dat].sig_t;
                    document.getElementById("fc").value = rpt[dat].sig_fc;
                    document.getElementById("fr").value = rpt[dat].sig_fr;
                    document.getElementById("obs").value = rpt[dat].sig_obs;
                    document.getElementById("medi").value = rpt[dat].GMENOMCOM;
                    document.getElementById("oidmed").value = rpt[dat].genMedicoc;
                    document.getElementById("oidc").value = rpt[dat].con_oid;
                    document.getElementById("signo").value = rpt[dat].sig_signo;
                    document.getElementById("so").value = rpt[dat].sig_saox;
                    
                }
                Datoscs2();
            }
            
        </script>
        <script>
            function Datoscs2(){
                var oidlt = $("#oidb").val();
                $.ajax({
                    type: "POST",
                    contentType: "application/x-www-form-urlencoded; charset=UTF-8",
                    url: "../../Laboratorio/controlador/php/sql/datoscs2.php",
                    data: {oidlt:oidlt},
                    success: mostrarcs2,
                    timeout: 4000,
                    error: errorEnviocs2
                });
            } 
            
            function errorEnviocs2() {
                    alert("error consulta");
                }
            
            function mostrarcs2(respuesta){
              
                rpt = $.parseJSON(respuesta);
                
                for(dat in rpt){
                    document.getElementById("ta15").value = rpt[dat].sig_ta;
                    document.getElementById("t15").value = rpt[dat].sig_t;
                    document.getElementById("fc15").value = rpt[dat].sig_fc;
                    document.getElementById("fr15").value = rpt[dat].sig_fr;
                    document.getElementById("so15").value = rpt[dat].sig_saox;
                    if(rpt[dat].sig_reac === "si"){
                        document.getElementById("r15").checked = true;
                        $("#reaccion15").attr('value','si');
                    }
                    document.getElementById("obs15").value = rpt[dat].sig_obs;
                }
                
                Datoscs3();
            }
            
        </script>
        <script>
            function Datoscs3(){
                var oidlt = $("#oidb").val();
                $.ajax({
                    type: "POST",
                    contentType: "application/x-www-form-urlencoded; charset=UTF-8",
                    url: "../../Laboratorio/controlador/php/sql/datoscs3.php",
                    data: {oidlt:oidlt},
                    success: mostrarcs3,
                    timeout: 4000,
                    error: errorEnviocs3
                });
            } 
            
            function errorEnviocs3() {
                    alert("error consulta");
                }
            
            function mostrarcs3(respuesta){
              
                rpt = $.parseJSON(respuesta);
                
                for(dat in rpt){
                    document.getElementById("ta30").value = rpt[dat].sig_ta;
                    document.getElementById("t30").value = rpt[dat].sig_t;
                    document.getElementById("fc30").value = rpt[dat].sig_fc;
                    document.getElementById("fr30").value = rpt[dat].sig_fr;
                    document.getElementById("so30").value = rpt[dat].sig_saox;
                    if(rpt[dat].sig_reac === "si"){
                        document.getElementById("r30").checked = true;
                        $("#reaccion30").attr('value','si');
                    }
                    document.getElementById("obs30").value = rpt[dat].sig_obs;
                }
                
                Datoscs4();
            }
            
        </script>
        <script>
            function Datoscs4(){
                var oidlt = $("#oidb").val();
                $.ajax({
                    type: "POST",
                    contentType: "application/x-www-form-urlencoded; charset=UTF-8",
                    url: "../../Laboratorio/controlador/php/sql/datoscs4.php",
                    data: {oidlt:oidlt},
                    success: mostrarcs4,
                    timeout: 4000,
                    error: errorEnviocs4
                });
            } 
            
            function errorEnviocs4() {
                    alert("error consulta");
                }
            
            function mostrarcs4(respuesta){
              
                rpt = $.parseJSON(respuesta);
                
                for(dat in rpt){
                    document.getElementById("ta60").value = rpt[dat].sig_ta;
                    document.getElementById("t60").value = rpt[dat].sig_t;
                    document.getElementById("fc60").value = rpt[dat].sig_fc;
                    document.getElementById("fr60").value = rpt[dat].sig_fr;
                    document.getElementById("so60").value = rpt[dat].sig_saox;
                    if(rpt[dat].sig_reac === "si"){
                        document.getElementById("r60").checked = true;
                        $("#reaccion60").attr('value','si');
                    }
                    document.getElementById("obs60").value = rpt[dat].sig_obs;
                }
                
                Datoscs5();
            }
            
        </script>
        <script>
            function Datoscs5(){
                var oidlt = $("#oidb").val();
                $.ajax({
                    type: "POST",
                    contentType: "application/x-www-form-urlencoded; charset=UTF-8",
                    url: "../../Laboratorio/controlador/php/sql/datoscs5.php",
                    data: {oidlt:oidlt},
                    success: mostrarcs5,
                    timeout: 4000,
                    error: errorEnviocs5
                });
            } 
            
            function errorEnviocs5() {
                    alert("error consulta");
                }
            
            function mostrarcs5(respuesta){
              
                rpt = $.parseJSON(respuesta);
                
                for(dat in rpt){
                    document.getElementById("ta1h").value = rpt[dat].sig_ta;
                    document.getElementById("t1h").value = rpt[dat].sig_t;
                    document.getElementById("fc1h").value = rpt[dat].sig_fc;
                    document.getElementById("fr1h").value = rpt[dat].sig_fr;
                    document.getElementById("so1h").value = rpt[dat].sig_saox;
                    if(rpt[dat].sig_reac === "si"){
                        document.getElementById("r1h").checked = true;
                        $("#reaccion1h").attr('value','si');
                    }
                    document.getElementById("obs1h").value = rpt[dat].sig_obs;
                }
                 document.getElementById("signos").disabled=true;
                 $("#guardarc").html('<input id="edit2" style="color:#42A2FC" type="button" value="Guardar Cambios" onclick="validar2();"/>');
                
            }
            
        </script>
        <script>
            function editarCS(){
                
                //oids tablas-> libroTrans,controlTrans,signosV
                var ltr_oid = $("#oidb").val();
                var con_oid = $("#oidc").val();
                var sig_signo = $("#signo").val();
                
                //datos controlTrans 
                var cants = $("#cants").val();
                var cante = $("#cante").val();
                var teml = $("#teml").val();
                var horai = $("#hora1").val();
                var horaf = $("#hora").val();
                var med = $("#oidmed").val();
                
                //signos vitales antes de la transfusion
                var ta = $("#ta").val();
                var t = $("#t").val();
                var fc = $("#fc").val();
                var fr = $("#fr").val();
                var so = $("#so").val();
                var obs = $("#obs").val();
                
                
                //signos vitales 15
                var ta15 = $("#ta15").val();
                var t15 = $("#t15").val();
                var fc15 = $("#fc15").val();
                var fr15 = $("#fr15").val();
                var so15 = $("#so15").val();
                var obs15 = $("#obs15").val();
                var reac15 = $("#reaccion15").val();
                /*if(document.getElementById("reaccion15").checked){
                    var reac15 = "si";
                }else{
                    reac15 = "";
                }*/
                
                //signos vitales 30
                var ta30 = $("#ta30").val();
                var t30 = $("#t30").val();
                var fc30 = $("#fc30").val();
                var fr30 = $("#fr30").val();
                var so30 = $("#so30").val();
                var obs30 = $("#obs30").val();
                var reac30 = $("#reaccion30").val();
                /*if(document.getElementById("reaccion30").checked){
                    var reac30 = "si";
                }else{
                    reac30 = "";
                }*/
                
                //signos vitales 60
                var ta60 = $("#ta60").val();
                var t60 = $("#t60").val();
                var fc60 = $("#fc60").val();
                var fr60 = $("#fr60").val();
                var so60 = $("#so60").val();
                var obs60 = $("#obs60").val();
                var reac60 = $("#reaccion60").val();
                /*if(document.getElementById("reaccion60").checked){
                    var reac60 = "si";
                }else{
                    reac60 = "";
                }*/
                
                //signos vitales 1h
                var ta1h = $("#ta1h").val();
                var t1h = $("#t1h").val();
                var fc1h = $("#fc1h").val();
                var fr1h = $("#fr1h").val();
                var so1h = $("#so1h").val();
                var obs1h = $("#obs1h").val();
                var reac1h = $("#reaccion1h").val();
                /*if(document.getElementById("reaccion1h").checked){
                    var reac1h = "si";
                }else{
                    reac1h = "";
                }*/
                
                
                $.ajax({
                    type: "POST",
                    contentType: "application/x-www-form-urlencoded; charset=UTF-8",
                    url: "../../Laboratorio/controlador/php/sql/editarCS.php",
                    data: {ltr_oid:ltr_oid,con_oid:con_oid,sig_signo:sig_signo,
                           cants:cants,cante:cante,teml:teml,horai:horai,horaf:horaf,med:med,
                           ta:ta,t:t,fc:fc,fr:fr,so:so,obs:obs,
                           ta15:ta15,t15:t15,fc15:fc15,fr15:fr15,so15:so15,obs15:obs15,reac15:reac15,
                           ta30:ta30,t30:t30,fc30:fc30,fr30:fr30,so30:so30,obs30:obs30,reac30:reac30,
                           ta60:ta60,t60:t60,fc60:fc60,fr60:fr60,so60:so60,obs60:obs60,reac60:reac60,
                           ta1h:ta1h,t1h:t1h,fc1h:fc1h,fr1h:fr1h,so1h:so1h,obs1h:obs1h,reac1h:reac1h},
                    success: ediCS,
                    timeout: 4000,
                    error: errorCS
                });
            }
            
            function errorCS(){
                alert("error al editar CS");
            }
            
            function ediCS(){
                alertify.success("Los datos se editaron satisfactoriamente");
            }
        </script>
        
        <script>
            function comfirm(){
                
                if(document.getElementById("r15").checked === true && document.getElementById("obs15").value === ""){
                   alertify.alert("POR FAVOR DEBE HACER OBSERVACIONES SOBRE LA REACCION", function () {
                        $("#obs15").focus();
                    });
                    return false;
                } 
                alertify.confirm("<p>ESTA SEGURO DE EDITAR LOS DATOS</p>", function (e) {
                            if (e) {
                               editarCS();
                            } else { 

                            }
                            }); 
                            return false;
            }
        </script>
        <script>
            function validar(){
                if($("#ta").val() === ""  && $("#t").val() === "" && $("#fc").val() === "" && $("#fr").val() === "" && $("#so").val() === ""){
                    enviarC();
                }else{
                    if($("#ta").val() === ""){
                        alertify.alert(" CAMPOS IMCOMPLETOS ", function () {
                            $("#ta").focus();
                        });
                        return false;
                    }
                    if($("#t").val() === ""){
                        alertify.alert(" CAMPOS IMCOMPLETOS ", function () {
                            $("#t").focus();
                        });
                        return false;
                    }
                    if($("#fc").val() === ""){
                        alertify.alert("CAMPOS IMCOMPLETOS ", function () {
                            $("#fc").focus();
                        });
                        return false;
                    }
                    if($("#fr").val() === ""){
                        alertify.alert("CAMPOS IMCOMPLETOS ", function () {
                            $("#fr").focus();
                        });
                        return false;
                    }
                    if($("#so").val() === ""){
                        alertify.alert("CAMPOS IMCOMPLETOS ", function () {
                            $("#so").focus();
                        });
                        return false;
                    }
                    if($("#ta").val() !== ""  && $("#t").val() !== "" && $("#fc").val() !== "" && $("#fr").val() !== "" && $("#so").val() !== ""){
                        if($("#ta15").val() === ""  && $("#t15").val() === "" && $("#fc15").val() === "" && $("#fr15").val() === ""&& $("#so15").val()===""){
                            enviarC();
                        }else{
                            if($("#ta15").val() === ""){
                                alertify.alert(" CAMPOS IMCOMPLETOSaka ", function () {
                                    $("#ta15").focus();
                                });
                                return false;
                            }
                            if($("#t15").val() === ""){
                                alertify.alert(" CAMPOS IMCOMPLETOS ", function () {
                                    $("#t15").focus();
                                });
                                return false;
                            }
                            if($("#fc15").val() === ""){
                                alertify.alert(" CAMPOS IMCOMPLETOS ", function () {
                                    $("#fc15").focus();
                                });
                            return false;
                            }
                            if($("#fr15").val() === ""){
                                alertify.alert("CAMPOS IMCOMPLETOS ", function () {
                                    $("#fr15").focus();
                                });
                                return false;
                            }
                            if($("#so15").val() === ""){
                                alertify.alert("CAMPOS IMCOMPLETOS ", function () {
                                    $("#so15").focus();
                                });
                                return false;
                            }
                            if($("#ta15").val() !== ""  && $("#t15").val() !== "" && $("#fc15").val() !== "" && $("#fr15").val() !== "" && $("#so15").val()!==""){
                                if($("#ta30").val() === ""  && $("#t30").val() === "" && $("#fc30").val() === "" && $("#fr30").val() === "" && $("#so30").val()===""){
                                    enviarC();
                                }else{
                                    if($("#ta30").val() === ""){
                                        alertify.alert(" CAMPOS IMCOMPLETOS ", function () {
                                            $("#ta30").focus();
                                        });
                                        return false;
                                    }
                                    if($("#t30").val() === ""){
                                        alertify.alert(" CAMPOS IMCOMPLETOS ", function () {
                                            $("#t30").focus();
                                        });
                                        return false;
                                    }
                                    if($("#fc30").val() === ""){
                                        alertify.alert(" CAMPOS IMCOMPLETOS ", function () {
                                            $("#fc30").focus();
                                        });
                                        return false;
                                    }
                                    if($("#fr30").val() === ""){
                                        alertify.alert("CAMPOS IMCOMPLETOS ", function () {
                                            $("#fr30").focus();
                                        });
                                        return false;
                                    }
                                    if($("#so30").val() === ""){
                                        alertify.alert("CAMPOS IMCOMPLETOS ", function () {
                                            $("#so30").focus();
                                        });
                                        return false;
                                    }
                                    if($("#ta30").val() !== ""  && $("#t30").val() !== "" && $("#fc30").val() !== "" && $("#fr30").val() !== "" && $("#so30").val()!==""){
                                        if($("#ta60").val() === ""  && $("#t60").val() === "" && $("#fc60").val() === "" && $("#fr60").val() === "" && $("#so60").val()===""){
                                            enviarC();
                                        }else{
                                            if($("#ta60").val() === ""){
                                                alertify.alert(" CAMPOS IMCOMPLETOS ", function () {
                                                    $("#ta60").focus();
                                                });
                                                return false;
                                            }
                                            if($("#t60").val() === ""){
                                                alertify.alert(" CAMPOS IMCOMPLETOS ", function () {
                                                    $("#t60").focus();
                                                });
                                                return false;
                                            }
                                            if($("#fc60").val() === ""){
                                                alertify.alert(" CAMPOS IMCOMPLETOS ", function () {
                                                    $("#fc60").focus();
                                                });
                                                return false;
                                            }
                                            if($("#fr60").val() === ""){
                                                alertify.alert("CAMPOS IMCOMPLETOS ", function () {
                                                    $("#fr60").focus();
                                                });
                                                return false;
                                            }
                                            if($("#so60").val() === ""){
                                                alertify.alert("CAMPOS IMCOMPLETOS ", function () {
                                                    $("#so60").focus();
                                                });
                                                return false;
                                            }
                                            if($("#ta60").val() !== ""  && $("#t60").val() !== "" && $("#fc60").val() !== "" && $("#fr60").val() !== "" && $("#so60").val() !==""){
                                                if($("#ta1h").val() === ""  && $("#t1h").val() === "" && $("#fc1h").val() === "" && $("#fr1h").val() === "" && $("#so1h").val() ===""){
                                                    enviarC();
                                                }else{
                                                    if($("#ta1h").val() === ""){
                                                        alertify.alert(" CAMPOS IMCOMPLETOS ", function () {
                                                            $("#ta1h").focus();
                                                        });
                                                        return false;
                                                    }
                                                    if($("#t1h").val() === ""){
                                                        alertify.alert(" CAMPOS IMCOMPLETOS ", function () {
                                                            $("#t1h").focus();
                                                        });
                                                        return false;
                                                    }
                                                    if($("#fc1h").val() === ""){
                                                        alertify.alert(" CAMPOS IMCOMPLETOS ", function () {
                                                            $("#fc1h").focus();
                                                        });
                                                        return false;
                                                    }
                                                    if($("#fr1h").val() === ""){
                                                        alertify.alert("CAMPOS IMCOMPLETOS ", function () {
                                                            $("#fr1h").focus();
                                                        });
                                                        return false;
                                                    }
                                                    if($("#so1h").val() === ""){
                                                        alertify.alert("CAMPOS IMCOMPLETOS ", function () {
                                                            $("#so1h").focus();
                                                        });
                                                        return false;
                                                    }
                                                    if($("#ta1h").val() !== ""  && $("#t15").val() !== "" && $("#fc15").val() !== "" && $("#fr15").val() !== "" && $("#so15")){
                                                        enviarC();
                                                    }

                                                }
                                            }

                                        }
                                    }

                                }
                            }
                    
                        }
            
                    }
                    
                }
            }
            
            function validar2(){
                if($("#ta").val() === ""  && $("#t").val() === "" && $("#fc").val() === "" && $("#fr").val() === "" && $("#so").val()===""){
                    comfirm();
                }else{
                    if($("#t").val() === ""){
                        alertify.alert(" CAMPOS IMCOMPLETOS ", function () {
                            $("#t").focus();
                        });
                        return false;
                    }
                    if($("#fc").val() === ""){
                        alertify.alert("CAMPOS IMCOMPLETOS ", function () {
                            $("#fc").focus();
                        });
                        return false;
                    }
                    if($("#fr").val() === ""){
                        alertify.alert("CAMPOS IMCOMPLETOS ", function () {
                            $("#fr").focus();
                        });
                        return false;
                    }
                    if($("#so").val() === ""){
                        alertify.alert("CAMPOS IMCOMPLETOS ", function () {
                            $("#so").focus();
                        });
                        return false;
                    }
                    if($("#ta").val() !== ""  && $("#t").val() !== "" && $("#fc").val() !== "" && $("#fr").val() !== "" && $("#so").val()!==""){
                        if($("#ta15").val() === ""  && $("#t15").val() === "" && $("#fc15").val() === "" && $("#fr15").val() === "" && $("#so15").val() ===""){
                            comfirm();
                        }else{
                            if($("#t15").val() === ""){
                                alertify.alert(" CAMPOS IMCOMPLETOS ", function () {
                                    $("#t15").focus();
                                });
                                return false;
                            }
                            if($("#fc15").val() === ""){
                                alertify.alert(" CAMPOS IMCOMPLETOS ", function () {
                                    $("#fc15").focus();
                                });
                            return false;
                            }
                            if($("#fr15").val() === ""){
                                alertify.alert("CAMPOS IMCOMPLETOS ", function () {
                                    $("#fr15").focus();
                                });
                                return false;
                            }
                            if($("#so15").val() === ""){
                                alertify.alert("CAMPOS IMCOMPLETOS ", function () {
                                    $("#so15").focus();
                                });
                                return false;
                            }
                            if($("#ta15").val() !== ""  && $("#t15").val() !== "" && $("#fc15").val() !== "" && $("#fr15").val() !== "" && $("#so15").val()!==""){
                                if($("#ta30").val() === ""  && $("#t30").val() === "" && $("#fc30").val() === "" && $("#fr30").val() === "" && $("#so30").val() ===""){
                                    comfirm();
                                }else{
                                    if($("#t30").val() === ""){
                                        alertify.alert(" CAMPOS IMCOMPLETOS ", function () {
                                            $("#t30").focus();
                                        });
                                        return false;
                                    }
                                    if($("#fc30").val() === ""){
                                        alertify.alert(" CAMPOS IMCOMPLETOS ", function () {
                                            $("#fc30").focus();
                                        });
                                        return false;
                                    }
                                    if($("#fr30").val() === ""){
                                        alertify.alert("CAMPOS IMCOMPLETOS ", function () {
                                            $("#fr30").focus();
                                        });
                                        return false;
                                    }
                                    if($("#so30").val() === ""){
                                        alertify.alert("CAMPOS IMCOMPLETOS ", function () {
                                            $("#so30").focus();
                                        });
                                        return false;
                                    }
                                    if($("#ta30").val() !== ""  && $("#t30").val() !== "" && $("#fc30").val() !== "" && $("#fr30").val() !== "" && $("#so30").val() !== ""){
                                        if($("#ta60").val() === ""  && $("#t60").val() === "" && $("#fc60").val() === "" && $("#fr60").val() === "" && $("#so60").val()=== ""){
                                            comfirm();
                                        }else{
                                            if($("#t60").val() === ""){
                                                alertify.alert(" CAMPOS IMCOMPLETOS ", function () {
                                                    $("#t60").focus();
                                                });
                                                return false;
                                            }
                                            if($("#fc60").val() === ""){
                                                alertify.alert(" CAMPOS IMCOMPLETOS ", function () {
                                                    $("#fc60").focus();
                                                });
                                                return false;
                                            }
                                            if($("#fr60").val() === ""){
                                                alertify.alert("CAMPOS IMCOMPLETOS ", function () {
                                                    $("#fr60").focus();
                                                });
                                                return false;
                                            }
                                            if($("#so60").val() === ""){
                                                alertify.alert("CAMPOS IMCOMPLETOS ", function () {
                                                    $("#so60").focus();
                                                });
                                                return false;
                                            }
                                            if($("#ta60").val() !== ""  && $("#t60").val() !== "" && $("#fc60").val() !== "" && $("#fr60").val() !== "" && $("#so60").val() !== ""){
                                                if($("#ta1h").val() === ""  && $("#t1h").val() === "" && $("#fc1h").val() === "" && $("#fr1h").val() === "" && $("#so1h").val() ===""){
                                                    comfirm();
                                                }else{
                                                    if($("#t1h").val() === ""){
                                                        alertify.alert(" CAMPOS IMCOMPLETOS ", function () {
                                                            $("#t1h").focus();
                                                        });
                                                        return false;
                                                    }
                                                    if($("#fc1h").val() === ""){
                                                        alertify.alert(" CAMPOS IMCOMPLETOS ", function () {
                                                            $("#fc1h").focus();
                                                        });
                                                        return false;
                                                    }
                                                    if($("#fr1h").val() === ""){
                                                        alertify.alert("CAMPOS IMCOMPLETOS ", function () {
                                                            $("#fr1h").focus();
                                                        });
                                                        return false;
                                                    }
                                                    if($("#so1h").val() === ""){
                                                        alertify.alert("CAMPOS IMCOMPLETOS ", function () {
                                                            $("#so1h").focus();
                                                        });
                                                        return false;
                                                    }
                                                    if($("#ta1h").val() !== ""  && $("#t15").val() !== "" && $("#fc15").val() !== "" && $("#fr15").val() !== "" && $("#so15").val() !==""){
                                                        comfirm();
                                                    }

                                                }
                                            }

                                        }
                                    }

                                }
                            }
                    
                        }
            
                    }
                    
                }
            }
            function asignarR15(){
                if(document.getElementById("r15").checked === true){
                    $("#reaccion15").attr('value',"si");
                }else{
                    $("#reaccion15").attr('value',"");
                }
            }
            
            function asignarR30(){
                if(document.getElementById("r30").checked === true){
                    $("#reaccion30").attr('value',"si");
                }else{
                    $("#reaccion30").attr('value',"");
                }
            }
            
            function asignarR60(){
                if(document.getElementById("r60").checked === true){
                    $("#reaccion60").attr('value',"si");
                }else{
                    $("#reaccion60").attr('value',"");
                }
            }
            function asignarR1h(){
                if(document.getElementById("r1h").checked === true){
                    $("#reaccion1h").attr('value',"si");
                }else{
                    $("#reaccion1h").attr('value',"");
                }
            }
            
        </script>
        
    </head>
    <body>
        <form id="controlt" method="post" action="">
            <table>
                <tr>
                    <td align="center" colspan="2">
                        NUMERO SELLO DE LA UNIDAD
                    </td>
                </tr>
                <tr><td colspan="2"></td></tr>
                <tr>
                    <td>
                        <input id="numS" type="text" name="txtNumS" value="" onchange="verificarC();"/> <input title='Buscar Unidad' id='buscador' type="button" value="" onclick='buscarU();'/></br>
                        <input id="ingreso" type="hidden" name="txtoidPac" value="" />
                        <input id="oidb" type="hidden" name="txtoidb" value="" />
                        <input id="oidc" type="hidden" name="txtoidc" value="" />
                        <input id="signo" type="hidden" name="txsigno" value="" />
                        <input type="hidden" id='numse' name="txtNumse" value="" />
                    </td>
                    <td></td>
                    <!--<td>
                        <input id="nuevo" type="button" value="Nuevo" onclick="document.location=('lTransR.php');"/>
                    </td>-->
                </tr>
                <tr>
                    <td colspan="2">
                        <div style="display: none">
                            <input type="text" name="" value="" />
                        </div>
                    </td>
                </tr>
            </table>
            </br>
            <div id="respuesta2" >
                
            </div>
            <div aling="center" id="respuesta">
                
            </div>
            </br>
            <table>
                <tr>
                    <td>
                        <strong>CONTROL DE TRANSFUSION SANGUINEA</strong>
                    </td>
                </tr>
            </table>
            </br>
            <table style='overflow:hidden;border:1px solid #d3d3d3;background:#fefefe;width:70%;-moz-border-radius:5px; /* FF1+ */-webkit-border-radius:5px; /* Saf3-4 */border-radius:5px;-moz-box-shadow: 0 0 4px rgba(0, 0, 0, 0.2);-webkit-box-shadow: 0 0 4px rgba(0, 0, 0, 0.2);font-size:12px;padding: 2%'>      
                    <tr>
                        <td>
                            Cantidad Solicitada
                            <input placeholder="ml" id='cants'  type="text" name="txtCants" value="" style="width: 30%"/>
                        </td>
                        <td>
                            Cantidad Entregada
                            <input placeholder="ml" id='cante' type="text" name="txtCante" value="" style="width: 30%"/>
                        </td>
                        <td>
                            Temperatura de Llegada
                            <input placeholder="ºC" id='teml' type="text" name="txtTempl" value="" style="width: 30%"/>
                        </td>
                    </tr>
                    <tr>
                        <td colspan="3" align="center" style='padding:5px 15px 5px; text-align:center;border-top:1px solid #e0e0e0; border-right:1px solid #e0e0e0;background: -moz-linear-gradient(100% 25% 90deg, #fefefe, #f9f9f9);background: -webkit-gradient(linear, 0% 0%, 0% 25%, from(#f9f9f9), to(#fefefe)); background:#e8eaeb;'>
                            Signos Vitales al Inicio de la Transfusion
                        </td>
                    </tr>
                    <tr>
                        <td style="width:1%" colspan="3">
                            
                        </td>
                    </tr>
                    <tr>
                        <td align="center">
                            <div class="example-container">
                                <div>
                                        <p>Hora Inicio Transfusion</p><input type="text" name="basic_example_1" id="hora1" value="" style="width:28%"/>
                                </div>					
                                    <pre style="display: none">
                                    $('#hora1').timepicker();
                                    </pre>
                            </div>
                        </td>
                        <td colspan="">
                            <table style='overflow:hidden;border:1px solid #d3d3d3;background:#fefefe;width:100%;-moz-border-radius:5px; /* FF1+ */-webkit-border-radius:5px; /* Saf3-4 */border-radius:5px;-moz-box-shadow: 0 0 4px rgba(0, 0, 0, 0.2);-webkit-box-shadow: 0 0 4px rgba(0, 0, 0, 0.2);font-size:12px'>
                                <tr align="center">
                                    <td >
                                        TA</br>
                                        <input type="text" id='ta' name="txtTA[]" value="" style="width: 90%"/>
                                    </td>
                                    <td>
                                        ºT</br>
                                        <input type="text" id='t' name="txtT[]" value="" style="width: 90%"/>
                                    </td>
                                    <td>
                                        FC</br>
                                        <input type="text" id='fc' name="txtFC[]" value="" style="width: 90%"/>
                                    </td>
                                    <td>
                                        FR</br>
                                        <input type="text" id='fr' name="txtFR[]" value="" style="width: 90%"/>
                                        <input type="hidden" name="txtsigno[]" value="at" />
                                    </td>
                                    <td>
                                        SatO2</br>
                                        <input type="text" id='so' name="txtSO[]" value="" style="width: 90%"/>
                                    </td>
                                </tr>
                            </table>
                        </td>
                        <td align="center">
                            <div class="example-container">
                                <div>
                                        <p>Hora Fin Transfusion</p><input type="text" name="basic_example_2" id="hora" value="" style="width:21%"/>
                                </div>					
                                    <pre style="display: none">
                                    $('#hora').timepicker();
                                    </pre>
                            </div>
                        </td>
                    </tr>
                    <tr>
                        <td style="height:10px" colspan="4">
                            
                        </td>
                    </tr>
                    <tr>
                        <td align="center">
                            Observaciones
                        </td>
                        <td align="center">
                             <textarea id="obs" placeholder="Observaciones" value="" name="txtObs[]" cols="58" rows="4" style="width: 90%"></textarea>
                             <input type="hidden" name="cbReaccion[]" value="no" />
                        </td>
                        <td onclick="buscarM();" align="center" >
                           <input placeholder="Medico Responsable" id="medi" type="text" name="txtMedr" value="" style="width: 100%"/>
                           <input id="oidmed" type="hidden" name="txtOIDM" value="" style="width: 100%"/>
                        </td>
                    </tr>
                    <tr>
                        <td colspan ="3" align="center" style='padding:5px 15px 5px; text-align:center;border-top:1px solid #e0e0e0; border-right:1px solid #e0e0e0;background: -moz-linear-gradient(100% 25% 90deg, #fefefe, #f9f9f9);background: -webkit-gradient(linear, 0% 0%, 0% 25%, from(#f9f9f9), to(#fefefe)); background:#e8eaeb;'>
                            Signos Vitales a los 15 Minutos
                        </td>
                    </tr>
                    <tr>
                        <td colspan="2">
                            <table style='overflow:hidden;border:1px solid #d3d3d3;background:#fefefe;width:100%;-moz-border-radius:5px; /* FF1+ */-webkit-border-radius:5px; /* Saf3-4 */border-radius:5px;-moz-box-shadow: 0 0 4px rgba(0, 0, 0, 0.2);-webkit-box-shadow: 0 0 4px rgba(0, 0, 0, 0.2);font-size:12px'>
                                <tr align="center">
                                    <td >
                                        TA</br>
                                        <input type="text" id='ta15' name="txtTA[]" value="" style="width: 50%" />
                                    </td>
                                    <td>
                                        ºT</br>
                                        <input type="text" id='t15' name="txtT[]" value="" style="width: 50%"/>
                                    </td>
                                    <td>
                                        FC</br>
                                        <input type="text" id='fc15' name="txtFC[]" value="" style="width: 50%"/>
                                    </td>
                                    <td>
                                        FR</br>
                                        <input type="text" id='fr15' name="txtFR[]" value="" style="width: 50%"/>
                                        <input type="hidden" name="txtsigno[]" value="15" />
                                    </td>
                                    <td>
                                        SatO2</br>
                                        <input type="text" id='so15' name="txtSO[]" value="" style="width: 50%"/>
                                    </td>
                                </tr>
                            </table>
                        </td>
                        <td>
                            <table style="font-size:80%">
                                <tr>
                                    <td align="center">
                                        Raeaccion</br>
                                        <input id="r15" type="checkbox" name="" value="si" onchange="asignarR15();"/>
                                        <input id="reaccion15" type="hidden" name="cbReaccion[]" value="" />
                                        
                                    </td>
                                    <td>
                                        <textarea id="obs15" placeholder="Observaciones" value="" name="txtObs[]" cols="58" rows="2" style="width: 100%"></textarea>
                                    </td>
                                </tr>
                            </table>
                        </td>
                    </tr>
                    <tr>
                        <td colspan ="3" align="center" style='padding:5px 15px 5px; text-align:center;border-top:1px solid #e0e0e0; border-right:1px solid #e0e0e0;background: -moz-linear-gradient(100% 25% 90deg, #fefefe, #f9f9f9);background: -webkit-gradient(linear, 0% 0%, 0% 25%, from(#f9f9f9), to(#fefefe)); background:#e8eaeb;'>
                            Signos Vitales a los 30 Minutos
                        </td>
                    </tr>
                    <tr>
                        <td colspan="2">
                            <table style='overflow:hidden;border:1px solid #d3d3d3;background:#fefefe;width:100%;-moz-border-radius:5px; /* FF1+ */-webkit-border-radius:5px; /* Saf3-4 */border-radius:5px;-moz-box-shadow: 0 0 4px rgba(0, 0, 0, 0.2);-webkit-box-shadow: 0 0 4px rgba(0, 0, 0, 0.2);font-size:12px'>
                                <tr align="center">
                                    <td >
                                        TA</br>
                                        <input type="text" id='ta30' name="txtTA[]" value="" style="width: 50%"/>
                                    </td>
                                    <td>
                                        ºT</br>
                                        <input type="text" id='t30' name="txtT[]" value="" style="width: 50%"/>
                                    </td>
                                    <td>
                                        FC</br>
                                        <input type="text" id='fc30' name="txtFC[]" value="" style="width: 50%"/>
                                    </td>
                                    <td>
                                        FR</br>
                                        <input type="text" id='fr30' name="txtFR[]" value="" style="width: 50%"/>
                                        <input type="hidden" name="txtsigno[]" value="30" />
                                    </td>
                                    <td>
                                        SatO2</br>
                                        <input type="text" id='so30' name="txtSO[]" value="" style="width: 50%"/>
                                    </td>
                                </tr>
                            </table>
                        </td>
                        <td>
                            <table style="font-size:80%">
                                <tr>
                                    <td align="center" style="width:19%">
                                        <input id="r30" type="checkbox" name="" value="si" onchange="asignarR30();"/>
                                        <input id="reaccion30" type="hidden" name="cbReaccion[]" value="" />
                                    </td>
                                    <td>
                                        <textarea id="obs30" placeholder="Observaciones" value="" name="txtObs[]" cols="58" rows="2" style="width: 100%"></textarea>
                                    </td>
                                </tr>
                            </table>
                        </td>
                    </tr>
                    <tr>
                        <td colspan ="3" align="center" style='padding:5px 15px 5px; text-align:center;border-top:1px solid #e0e0e0; border-right:1px solid #e0e0e0;background: -moz-linear-gradient(100% 25% 90deg, #fefefe, #f9f9f9);background: -webkit-gradient(linear, 0% 0%, 0% 25%, from(#f9f9f9), to(#fefefe)); background:#e8eaeb;'>
                            Signos Vitales a los 60 Minutos
                        </td>
                    </tr>
                    <tr>
                        <td colspan="2">
                            <table style='overflow:hidden;border:1px solid #d3d3d3;background:#fefefe;width:100%;-moz-border-radius:5px; /* FF1+ */-webkit-border-radius:5px; /* Saf3-4 */border-radius:5px;-moz-box-shadow: 0 0 4px rgba(0, 0, 0, 0.2);-webkit-box-shadow: 0 0 4px rgba(0, 0, 0, 0.2);font-size:12px'>
                                <tr align="center">
                                    <td >
                                        TA</br>
                                        <input type="text" id='ta60' name="txtTA[]" value="" style="width: 50%"/>
                                    </td>
                                    <td>
                                        ºT</br>
                                        <input type="text" id='t60' name="txtT[]" value="" style="width: 50%"/>
                                    </td>
                                    <td>
                                        FC</br>
                                        <input type="text" id='fc60' name="txtFC[]" value="" style="width: 50%"/>
                                    </td>
                                    <td>
                                        FR</br>
                                        <input type="text" id='fr60' name="txtFR[]" value="" style="width: 50%"/>
                                        <input type="hidden" name="txtsigno[]" value="60" />
                                    </td>
                                    <td>
                                        SatO2</br>
                                        <input type="text" id='so60' name="txtSO[]" value="" style="width: 50%"/>
                                    </td>
                                </tr>
                             </table>
                        </td>
                        <td>
                            <table style="font-size:80%">
                                <tr>
                                    <td align="center" style="width:19%">
                                        <input id="r60" type="checkbox" name="" value="si" onchange="asignarR60();"/>
                                        <input id="reaccion60" type="hidden" name="cbReaccion[]" value="" />
                                    </td>
                                    <td>
                                        <textarea id="obs60" placeholder="Observaciones" value="" name="txtObs[]" cols="58" rows="2" style="width: 100%"></textarea>
                                    </td>
                                </tr>
                            </table>
                        </td>
                    </tr>
                    <tr>
                        <td colspan ="3" align="center" style='padding:5px 15px 5px; text-align:center;border-top:1px solid #e0e0e0; border-right:1px solid #e0e0e0;background: -moz-linear-gradient(100% 25% 90deg, #fefefe, #f9f9f9);background: -webkit-gradient(linear, 0% 0%, 0% 25%, from(#f9f9f9), to(#fefefe)); background:#e8eaeb;'>
                            Signos Vitales 1 Hora Despues
                        </td>
                    </tr>
                    <tr>
                        <td colspan="2">
                            <table style='overflow:hidden;border:1px solid #d3d3d3;background:#fefefe;width:100%;-moz-border-radius:5px; /* FF1+ */-webkit-border-radius:5px; /* Saf3-4 */border-radius:5px;-moz-box-shadow: 0 0 4px rgba(0, 0, 0, 0.2);-webkit-box-shadow: 0 0 4px rgba(0, 0, 0, 0.2);font-size:12px'>
                                <tr align="center">
                                    <td >
                                        TA</br>
                                        <input type="text" id='ta1h' name="txtTA[]" value="" style="width: 50%"/>
                                    </td>
                                    <td>
                                        ºT</br>
                                        <input type="text" id='t1h' name="txtT[]" value="" style="width: 50%"/>
                                    </td>
                                    <td>
                                        FC</br>
                                        <input type="text" id='fc1h' name="txtFC[]" value="" style="width: 50%"/>
                                    </td>
                                    <td>
                                        FR</br>
                                        <input type="text" id='fr1h' name="txtFR[]" value="" style="width: 50%"/>
                                        <input type="hidden" name="txtsigno[]" value="1h" />
                                    </td>
                                    <td>
                                        SatO2</br>
                                        <input type="text" id='so1h' name="txtSO[]" value="" style="width: 50%"/>
                                    </td>
                                </tr>
                            </table>
                        </td>
                        <td>
                            <table style="font-size:80%">
                                <tr>
                                    <td align="center" style="width:19%">
                                        <input id="r1h" type="checkbox" name="" value="si" onchange="asignarR1h();"/>
                                        <input id="reaccion1h" type="hidden" name="cbReaccion[]" value="" />
                                    </td>
                                    <td>
                                        <textarea id="obs1h" placeholder="Observaciones" value="" name="txtObs[]" cols="58" rows="2" style="width: 100%"></textarea>
                                    </td>
                                </tr>
                            </table>
                        </td>
                    </tr>
                </table>
                </br>
                <table>
                    <tr>
                        <td>
                            <div id="guardarc">
                                
                            </div>
                        </td>
                        <td align="center">
                            <input id="signos"  type="button" value="Registrar Signos" onclick="validar();"/>
                        </td>
                        <td align="center">
                            <input id="nuevos"  type="button" value="Nuevo" onclick="document.location=('lTransR.php');"/>
                        </td>
                    </tr>
                </table>
                </br></br>
        </form>
    </body>
</html>
